treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Substituting header for div tags

  • For structural/SEO purposes, I wish to insert <h1> and <h2> tags in my home page at www.vintagetextile.com However, I want to retain the same (or as close as possible) styling currently used for the 2 elements that will now have header tags around them.
    At the upper left of the home page ":High Style Vintage Clothing & 18th Century Costume" is currently styled by:
    div.flft{float:left;height:74px;width:60%;font:bold 1.15em Verdana,Tahoma,Helvetica,sans-serif;position:relative;left:3em;color:#666666;}

    As you can see from the Page Source, the code is:
    <div class="flft"><p>High Style Vintage Clothing<br>&amp; 18th Century Costume</p></div>	

    After changing the code to reference the new rule, when I try
    h1.flft{float:left;height:74px;width:60%;font:bold 1.15em Verdana,Tahoma,Helvetica,sans-serif;position:relative;left:3em;color:#666666;}

    I get a totally different, unwanted look. How can I do the CSS rule to get as close as possible to the current styling but using an <h1> instead of <div> tag?

    I have the same question for the Search element down a bit on the page, where the code is:
     <div class="srch"><a class="sr" href="searchvt.htm">Search </a>Vintage Textile.</div> 

    and the relevant styles:
     .srch{padding:.3em;margin:.4em 0 .6em 0;background-color:#F5EBD6;color:Black;font:bold 1.4em "Times New Roman",Times,serif;}

    a.sr:link{color:#00f;background-color:#F5EBD6;text-decoration:none;font:1.4em;}
    a.sr:visited{color:#00f;background-color:#F5EBD6;text-decoration:none;}

    Thanks in advance to you experts!
  • This:
    <div class="flft"><p>High Style Vintage Clothing<br>&amp; 18th Century Costume</p></div>

    Needs to change to:
    <h1 class="flft">High Style Vintage Clothing<br>&amp; 18th Century Costume</h1>

    Note that the paragraph tag is also gone.

    Since h1 elements are actually displayed as block elements, they can be styled exactly the same as a div, so your CSS should work just fine.
  • And don't forget to apply any styles you had for

    tags to the new header tag.