Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2004
    Thanked 0 Times in 0 Posts

    Adding HTML to css template

    I understand the basics of css, but am not an expert so please be gentle...

    I recently had a Website template done for my site.. the template was done using css

    The content I want to place inside of the template is all done in HTML.

    Is it ok to place HTML coding inside a CSS template?

    Is there a specific way I can place the HTML content inside the template as is? Or will I have to format it somehow?


  • #2
    Regular Coder
    Join Date
    May 2008
    Oxford, UK
    Thanked 27 Times in 27 Posts
    the css template will be html with a link to a css file to style it up, or all the styles will be at the top of the page.

    So basically you want to add html to an html page, which is perfectly fine

  • #3
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Springfield, IL
    Thanked 87 Times in 87 Posts
    html is the "what" that is displayed and css is the "how". You can put css inside of a html document. You can do this two ways. You can also attach css to a html document by including it, again in two ways.

    Some segments might look like this:

    html piece:
    <div class="someclass"><p>Now is the <span class="otherclass">time </span> for all good men ...</p></div>

    css piece:
    .someclass {float:left; color:#0000ff;}
    .otherclass {color:#ff0000;}

    You will see "Now is the " in blue, "time" in red, "for all..." back to blue. If the user decided that all text should be in green on every page, then everywhere that ".someclass" is used would turn green by changing the css from blue (#0000ff) to green (#00ff00).
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls


    Posting Permissions

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