Results 1 to 4 of 4

Thread: Help with a <div> tag

  1. #1
    Join Date
    Nov 2006
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with a <div> tag

    OK, so i want add a page title div. I want it to work much how the Chrome CSS Drop Down Menu works in that you make a 3px. X 50px. Image that will make up a background around the text that you assign. Like how this page puts a background behind the "Mission Statement" I have the CSS semi coded and it looks like this:
    Code:
    DIV.title{
         border: 1px solid #BBB;
         background: url(PATH/TO/BG_IMAGE.gif) center center repeat-x; 
    }
    But how would i add in the HTML so that the title would show up?
    Would it look like:
    Code:
    <div class="title"><b>PAGE TITLE HERE</b></div>
    Yes, i know their is the
    Code:
    <head>
        <title>TITLE_HERE</title>
    But I want to have a page title thing in the actual page as well.

    Any ideas?

    -GT

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    All you have to do in the css is set the class properly:
    Code:
    .title{
         border: 1px solid #BBB;
         background: url(PATH/TO/BG_IMAGE.gif) center center repeat-x; 
    }
    The DIV you had there wasn't necessary. And your markup should look like this:
    Code:
    <div class="title"><b>PAGE TITLE HERE</b></div>
    (the same as before)
    - Mike

  3. #3
    Join Date
    Nov 2006
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh yes, i know the DIV.[div name] wasn't neccesary, i just use it to keep all my CSS neat. (mostly because other eople on my web team are HTML/CSS illiterate.)
    Thanks for confirming my code!

    -GT

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    No prob.
    - Mike

Bookmarks

Posting Permissions

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