View Full Version : Adding HTML to css template

07-09-2008, 02:06 PM
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?


07-09-2008, 02:09 PM
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 :)

07-09-2008, 05:57 PM
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).