/    Sign up×
Community /Pin to ProfileBookmark

Slicing for CSS + Layout

In need of a CSS pro. I am somewhat of a newbie at CSS. I created my layout in photoshop — and then attempted to group it to slice for CSS. However my html looks logical as far as grouping goes — but I think I butchered the css because the layout has been modified.

  • I sliced the psd into 7 images (not using all of them) — is that a good start or should I redo?

  • How do you get links to view vertically instead of horizontal?

  • The ‘shop categories’ sidebar (containing links) isn’t working with the css I created…? Should I place the sidebar outside of the content (currently it is within the main content)?

  • The main content is supposed to be below the large image of women/jewelry — how do I accomplish this?

  • I have attached a jpg of the layout I am trying to achieve with CSS.

  • Here is an attached link of what I am trying to achieve [URL=”http://s215038318.onlinehome.us/brand_site.html”]http://s215038318.onlinehome.us/brand_site.html[/URL]

    [B]HTML:[/B]

    [code=html]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
    <html>
    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
    <title>Brand Title</title>
    </head>

    <body>
    <div id=”wrapper”>
    <div id=”header1″>
    <ul id=”nav1″>
    <li><a href=””>Shopping Cart</a></li>
    <li><a href=””>Assistance</a></li>
    <li><a href=””>Find A Store</a></li>
    </ul>
    </div>
    <div id=”header2″>
    </div>
    <div id=”mainmenu”>
    </div>

    <div id=”logo”>
    </div>

    <div id=”promoimage”>
    </div>

    <div id=”content”>
    <h2>Content Here</h2>

    <div id=”sidebar”>
    <h2>shop categories</h2>
    <ul>
    <li><a href=””>bracelets</a></li>
    <li><a href=””>charms</a></li>
    <li><a href=””>earrings</a></li>
    <li><a href=””>necklaces</a></li>
    <li><a href=””>rings</a></li>
    <li><a href=””>pendants</a></li>
    <li><a href=””>watches</a></li>
    <li><a href=””>gifts</a></li>
    </ul>
    </div>
    <!– sidebar –>

    <div id=”padder”></div>
    </div>
    </div>

    <div id=”footer”>
    <p>Copyright 2008 &copy; Brand Name. All rights reserved.</p>
    <ul>
    <li><a href=””>About Us</a></li>
    <li><a href=””>Security + Privacy</a></li>
    <li><a href=””>Store Policies</a></li>
    <li><a href=””>Terms of Use</a></li>
    </ul>
    </div>
    </div>
    </body>
    </html>[/code]

    [B]CSS[/B] My Attempt…

    [CODE]
    * html #wrapper {
    height: 100%;
    }
    #header1 {
    height: 36px;
    background: #000000;
    }
    #header2 {
    height: 146px;
    background-image:url(css%20images/header_bg.jpg);
    background-repeat:repeat-x;
    }
    #nav1 {
    height: 23px;
    position: absolute;
    top: 30px;
    right: 20px;
    background: #FFFFFF;
    }
    #nav li {
    list-style: none;
    float: right;
    padding-right: 7px;
    }
    #mainmenu {
    height: 26px;
    background-color:#333333;
    }
    #logo {
    float: left;
    background: #CCCCCC;
    }
    #content {
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #FFFFFF;
    height: 42px;
    padding: 10px;
    overflow: hidden;
    margin-top: 10px;
    margin-right: 0;
    margin-bottom: 10px;
    margin-left: 0;
    }
    * html #content {
    overflow: visible;
    height: 1%;
    }
    #promoimage{
    width: 562px;
    height: 332px;
    background-image: url(images/ads/lux_slices_05.gif);
    font-size: 1px;
    color: #333333;
    float: right;
    position: fixed;
    z-index: 1;
    }
    #sidebar{
    width: 187px;
    margin-left: -187px;
    background: #000000;
    float: left;
    position: fixed;
    z-index: 2;
    }
    #padder {
    height: 48px;
    }
    #footer {
    font-size: 80%;
    font: kartika;
    color: #FFFFFF;
    text-align: center;
    padding-top: 10px;
    width: 750px;
    height: 48px;
    margin: -48px auto 0;
    background-color: #333333;
    }
    #footer ul {
    }
    #footer li {
    font: kartika;
    list-style: none;
    display: inline;
    }
    #footer .last {
    border: 0;
    }

    #footer a {
    color: #FFFFFF;
    padding: 0 0.5em;
    text-decoration: none;
    }
    #footer a:hover {
    color: #CCCCCC;
    }[/CODE]

    to post a comment
    CSS

    13 Comments(s)

    Copy linkTweet thisAlerts:
    @CentauriNov 09.2007 — The image load here can be reduced quite considerably using repeating narrow slices for the majority of the layout.

    As noted in your other post about the menu, I will address both this and the menu when I get some time tomorrow.
    Copy linkTweet thisAlerts:
    @ne_plus_ultraauthorNov 09.2007 — The image load here can be reduced quite considerably using repeating narrow slices for the majority of the layout.

    As noted in your other post about the menu, I will address both this and the menu when I get some time tomorrow.[/QUOTE]

    I made some progress on this today - it has come a long way. As you know, I am attempting to achieve the jpg that I created below:

    http://www.s215038318.onlinehome.us/brand_site.html


    I have made many updates - learning along the way. These forums are very helpful indeed. I now have 3 main areas to tackle:

  • - navigation menu (drop-down)

  • - Alignment of the 'logo' and remaining 'header'... not sure how that works

  • - recreating the affect shown on the brand_site link in the content area beneath the picture... seems to me I could do it with a left and right border image?


  • Here is what I have so far...

    http://www.s215038318.onlinehome.us/company.html
    Copy linkTweet thisAlerts:
    @CentauriNov 09.2007 — There is really no need to have the top navigation links contained with its own div - just style the <ul> directly. The logo can simply be a <h1> heading within the top header div, which can be set to display an image instead of text in the css. The promo image I would include as a background to the content div - a suitable top padding will space the content below the image.

    With just a brief look, I would mark up the beginning of the html more like :[CODE]<div id="wrapper">
    <ul id="nav1" name="nav1">
    <li><a href="#">Shopping Cart </a></li>
    <li><a href="#">Assistance </a>|</li>
    <li><a href="#">Find A Store </a>|</li>
    </ul>

    <div id="header">
    <h1>Logo Here</h1>
    </div>

    <ul id="mainmenu">
    ...menu stuff..
    </ul>

    <div id="content">[/CODE]

    The content div I would probably put before the sidebar div in the html.

    Will look at it more more detail tomorrow - especially the menu.

    You are getting the hang of it, though ?
    Copy linkTweet thisAlerts:
    @CentauriNov 09.2007 — As far as the side borders on the content area goes, I would take a thin (maybe 5 or 10px high) slice from the original graphic right across the full width of the wrapper and tile it vertically as a background to the wrapper, which will give a faux column effect so that it doesn't matter whether the sidebar or content is longest. The header and navbar graphics would hide the columns at the top.
    Copy linkTweet thisAlerts:
    @ne_plus_ultraauthorNov 10.2007 — As far as the side borders on the content area goes, I would take a thin (maybe 5 or 10px high) slice from the original graphic right across the full width of the wrapper and tile it vertically as a background to the wrapper, which will give a faux column effect so that it doesn't matter whether the sidebar or content is longest. The header and navbar graphics would hide the columns at the top.[/QUOTE]

    Very good idea. I will try that.
    Copy linkTweet thisAlerts:
    @ne_plus_ultraauthorNov 11.2007 — As far as the side borders on the content area goes, I would take a thin (maybe 5 or 10px high) slice from the original graphic right across the full width of the wrapper and tile it vertically as a background to the wrapper, which will give a faux column effect so that it doesn't matter whether the sidebar or content is longest. The header and navbar graphics would hide the columns at the top.[/QUOTE]

    I got the background repeat on the y axis for the left side of the column. How do you apply to the right side?
    Copy linkTweet thisAlerts:
    @CentauriNov 11.2007 — Both left and right sides should be done at once with a wide, squat graphic slice tiled vertically. Here is my take on this layout, including the css unordered list dropdown menu :

    http://www.centauriaudio.com.au/test/ne_plus_ultra/template2/index.html

    Here, the top border graphic of the content area I incorporated in the promo image (which is a background of the content area), and the bottom border of the content area is incorporated in the footer top graphic. I also incorporated a sample flash graphic in the side bar, where you mentioned you did want one, to demonstrate the dropdown goes over it.
    Copy linkTweet thisAlerts:
    @ne_plus_ultraauthorNov 11.2007 — Both left and right sides should be done at once with a wide, squat graphic slice tiled vertically. Here is my take on this layout, including the css unordered list dropdown menu :

    http://www.centauriaudio.com.au/test/ne_plus_ultra/template2/index.html

    Here, the top border graphic of the content area I incorporated in the promo image (which is a background of the content area), and the bottom border of the content area is incorporated in the footer top graphic. I also incorporated a sample flash graphic in the side bar, where you mentioned you did want one, to demonstrate the dropdown goes over it.[/QUOTE]


    Okay. So your attempt is sooo much better than mine. I noticed with mine that it looked awkward in IE. However, yours seems to work. I will take a look at this and see where I went wrong. Thanks Centauri.
    Copy linkTweet thisAlerts:
    @ne_plus_ultraauthorNov 11.2007 — Both left and right sides should be done at once with a wide, squat graphic slice tiled vertically. Here is my take on this layout, including the css unordered list dropdown menu :

    http://www.centauriaudio.com.au/test/ne_plus_ultra/template2/index.html

    Here, the top border graphic of the content area I incorporated in the promo image (which is a background of the content area), and the bottom border of the content area is incorporated in the footer top graphic. I also incorporated a sample flash graphic in the side bar, where you mentioned you did want one, to demonstrate the dropdown goes over it.[/QUOTE]



    I am going through this step by step. The 1 thing I noticed is that the menu doesn't seem to drop down in IE? Is there a fix I can apply?

    Thanks.
    Copy linkTweet thisAlerts:
    @CentauriNov 11.2007 — It works fine for me with both IE6 and 7 - is this when you view the example where I have it, or locally on your machine? There is a javascript file sfhover.js that gets IE to recognise the hover on <li>s. (there is also another javascript file swfobject.js which is the flash embedder).
    Copy linkTweet thisAlerts:
    @ne_plus_ultraauthorNov 12.2007 — It works fine for me with both IE6 and 7 - is this when you view the example where I have it, or locally on your machine? There is a javascript file sfhover.js that gets IE to recognise the hover on <li>s. (there is also another javascript file swfobject.js which is the flash embedder).[/QUOTE]

    How do you apply a javascript file? Is it externally linked or can you include within your css file? Not familiar with the concept...
    Copy linkTweet thisAlerts:
    @CentauriNov 12.2007 — In the code of the page I linked, just before the closing </head> you will see the two javascript files linked :[CODE]<script type="text/javascript" src='sfhover.js'></script>
    <script type="text/javascript" src="swfobject.js"></script>

    </head>[/CODE]


    The sfhover javascript file direct link: http://www.centauriaudio.com.au/test/ne_plus_ultra/template2/sfhover.js

    The swfobject javascript file direct link: http://www.centauriaudio.com.au/test/ne_plus_ultra/template2/swfobject.js

    These two files go in the same folder as the html. The first file makes IE work like proper browsers on hover, while the second embeds flash files.
    Copy linkTweet thisAlerts:
    @ne_plus_ultraauthorNov 12.2007 — In the code of the page I linked, just before the closing </head> you will see the two javascript files linked :[CODE]<script type="text/javascript" src='sfhover.js'></script>
    <script type="text/javascript" src="swfobject.js"></script>

    </head>[/CODE]


    The sfhover javascript file direct link: http://www.centauriaudio.com.au/test/ne_plus_ultra/template2/sfhover.js

    The swfobject javascript file direct link: http://www.centauriaudio.com.au/test/ne_plus_ultra/template2/swfobject.js

    These two files go in the same folder as the html. The first file makes IE work like proper browsers on hover, while the second embeds flash files.[/QUOTE]


    Great. I will review. Thanks.
    ×

    Success!

    Help @ne_plus_ultra spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...