www.webdeveloper.com
Results 1 to 5 of 5

Thread: Span Width w/ BG Image...

  1. #1
    Join Date
    Apr 2005
    Posts
    67

    Span Width w/ BG Image...

    http://www.sureo.com/tcg/template.php

    the style sheet is here:

    http://www.sureo.com/tcg/template.css

    ~first off, on the initial load, how come the header image is loading late and last?

    ~2nd of all, I am having problems with getting the menu header bg image or span to cover the full length of the parent div...
    i think you can see from the site what i mean!

    ~next, how do i center that text vertically over that footer div/image?

  2. #2
    Join Date
    Apr 2005
    Location
    Portsmouth, UK
    Posts
    157
    nodaa90,

    First, header image - probably because it's the biggest image on the page. Text loads quickly, images take time, the bigger the longer. Anyhow, for me (hi-speed connection) it loaded at the same time as the rest of the page anyway - no problems.

    Second, with regard to your header bg image (assuming you mean the background behind "menu header"), here's what you put in your code:
    Code:
    CSS:
    .menu_h
    {
    	background-repeat:repeat;
    	text-align:center;
    	
     	border:1px solid #DEE3E7;
     	background-image:url(./images/hdmenu.png);	
    }
    
    HTML:
    <span class="menu_h">
    menu header
    </span>
    That span tells me (and CSS) that you want a span behind the text "menu header" with a certain background - not that you want a child division filling a certain area of a parent division, regardless of what text you put on top of it. If you change your text to "the menu header goes here", the background (as it is now) will just expand to fill in the area behind the text b/c that's all you've told it to do, so far...

  3. #3
    Join Date
    Apr 2005
    Posts
    67
    well than, heh, im not sure how im supposed to do it right.. is using span the right way to go...im not sure how to get around this easily...

    i understand what i did wrong tho...

    *I belive i tried specifying width of that class, with percents AND aboslute px...i remember it still not working

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,637
    Span by default is an in-line element, therefore width does not apply to it. Besides, semantically it would make more sense to use paragraphs, or an unordered list (and thus LI tags) for the navigation items, not SPAN and BR tags. Then you would apply your class to the P or LI tag, whichever route you take.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Apr 2005
    Location
    Portsmouth, UK
    Posts
    157
    NogDog just beat me to it - and he's exactly right. If you want to control width/height attributes, you need a block-level element.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles