View Full Version : css to html

08-05-09, 16:48
Hey, I'm making a website for someone (coz she's even more useless at it than I am) and I have a web template to use, and it's in css and I need it to be html....erm, if there's already a thread, can you point me in the direction, and if there isn't please can you point out a useful site to explain, or better yet, PLEASE tell me in plain, simple, easy to understand English coz nothing I've read so far makes sense and I don't have the time to be learning. Thank you.


08-05-09, 17:18
You don't convert CSS to HTML, you use both. HTML is for the content, and CSS is used for the formatting of that content. They are two different things, and you use them together.

If you meant using HTML formatting instead of CSS, then that is an old standard that isn't used any more and is not valid. Plus, CSS is a lot more powerful than HTML formatting.

See here: http://www.w3schools.com/css/css_intro.asp

08-05-09, 17:51
I really don't know.

It looks like this

I know a little html

I know nothing about css

08-05-09, 17:58
There are no CSS files in that directory? You aren't talking about any inline CSS are you? (CSS within a HTML document).

There are only HTML and PHP files there. Are you sure you aren't getting CSS and PHP mixed up, because those are two completely differently things.

08-05-09, 17:59
No. I have a template that is in css that I want to use here, but it doesn't understand and I want to try and turn it into html

I don't want it converting so much as translating...

Ah well, thanx Jamie, I'll work on it later

08-05-09, 18:01
The first thing that I would do is run through a tutorial which explains what CSS (and even HTML) is and how it is used, then you be able to understand more about it. Please see my original link: http://www.w3schools.com/css/css_intro.asp

CSS is used in conjunction with HTML. To reference HTML elements to CSS, you will have to give them either a class or an ID, which is then referenced with your CSS document. Hope I aren't being too confusing.

08-05-09, 22:04
^good site to understand CSS and HTML is to go to www.htmldog.com
as per not using HTML properties to give elements a style, I say don't listen to that rubbish about it not being "valid". Browsers will still support it, you just don't get a shiny stamp of validation. Heck.. not all browsers even render CSS layouts the same.

but... you appear to not have any "style.css" external stylesheets in your directory, but are rather using PHP pages (which may have inline CSS or other implementation of CSS within them). But regardless... you have no index file!!

09-05-09, 12:35
Being valid isn't rubbish, it does ensure that it displays the same in all browsers and is more accessible. Being valid actually shows a level of professionalism and perfectionism, and some clients expect their websites to be valid. I always code websites from scratch and always ensure that my coding is easy and clear enough to understand, and is valid.

Plus, CSS is far easier and more flexible for updating layouts. You only have to edit one external file for the whole site, plus you have a lot more control over elements with CSS formatting than you would with HTML formatting. HTML formatting is a very old standard and is no longer used.


09-05-09, 15:23
well I understand what you are saying about validation being professional, but for my own personal sites, I never worry about getting it to validate. I count it as a win if it renders the same in all major browsers. Fact of the matter though is that IE is behind times with CSS support though. So even if you code your page such that it validates, IE may not render it properly (unless the only thing you code against is IE, in which case it may not render properly in the other browsers). Opera is a handy broswer in that you can right click a page and choose the link to "validate" it - or press Ctrl+Alt+Shift+U. Even www.google.com doesn't validate and spits out 64 errors and 7 warnings. One of the main things for my pages that keeps it from validating is not declaring a doctype. But regardless of that... browsers still read it as HTML 4.0


09-05-09, 20:16
^ Guys, why I have a feeling that you won't beat each other nevertheless? :mis:

09-05-09, 20:26
Anyway, don't get me wrong - not all sites are valid, and they still work perfectly fine. I personally like to get things valid to 'traditional', not 'strict' or anything - I'm not mad about validity all the time, some things you can't help be invalid (such as opacity for IE). I do just like to ensure that most things are valid enough.

But anyway, we were talking about CSS and not validity; CSS is still a lot more beneficial over HTML formatting as it is a lot more flexible. You can do a lot more with CSS, and is much easier to update.

And Alex, we aren't arguing - everyone has different ways of doing things, and isn't necessarily right or wrong.

09-05-09, 20:39
^ No objections from me as long as you don't forget (while persuading each other) about main purpose of this thread exactly ;)