|
| |
|
|
StevieB
Posts: 80 Joined: 8/11/2005 From: Yuma, AZ USA Status: offline
|
confussed css beginer using fp02 - 8/27/2005 19:58:41
I'm trying to make my site HTML 4.01 Strict compatible, one step at a time. I built a simple style sheet for body, text size, color, alignment and links, then linked it to an existing page. Problem One: The code I used to link the css created another HTML 4.01 Strict compatible error, bringing my total to 39. Here's the code... <link rel="stylesheet" type="text/css" href="core-style.css" /> and the error... Line 20 column 62: character data is not allowed here. Problem Two: Obviously the FP02 code on the page has not changed, do I need to clean up the code or will the style sheet over ride it? If you have to hand code everything then why use FP?? Or should I build pages only after a css is created? Problem Three: Most other problems have to do with alignment and I cant seem to find a way to align tables or images. If I insert an image that needs to be aligned left the FP code is ... <img alt="..." src="speed/65108.jpg" border="0" align="left" width="110" height="87"> How do I address that with css, after all some images need to be aligned right, some left and some center, and tables the same way. How do you address all of the possibilities in css?? Sorry I know this is a lot, but I'm really lost. After 13 hrs of tutorials and css editors I feel more confused than when I started. Any help is on any part of my rant is GREATLY appreciated, Steve
|
|
|
|
Nicole
Posts: 2830 Joined: 9/15/2004 From: Nambucca / Kempsey, Australia Status: offline
|
RE: confussed css beginer using fp02 - 8/27/2005 21:02:00
Hi Steve, Firstly, one of the main objectives of CSS is so you can clean up all the code in a page and have it styled from an external style sheet. It's important that you remember that inline styles (the ones appear alongside each element) take precedence over other styles, embedded styles take precedence over any external styles but not over inline styles, and external style sheets (like the one you're linking to) only take effect if elements aren't styled either inline or with an embedded style at the top of your code. By linking to a style sheet and leaving all the code the same, that style sheet isn't doing anything to the styles of individual elements on that page because you still have those elements styled inline. I hope that makes sense. So, yes, you'll have to go through and take out any inline properties and values and place them in your external style sheet. For instance: For an images that you want consistently displayed across many pages, or many images in the same page, your style sheet could look like this: img { border: 1px solid #000000; float: right; margin: 5px; } If you want half your images to be aligned right and the other half left, create classes for your images to produce the desired result: img.class1 {......... } img.class2 {....... } Then take out the inline styles for the images in your page code and just leave the <img> tag but include the class: <img class="class1> I hope that helps. Also, quite often when trying to validate a page, it's best to attack one error at a time and then revalidate. Often one unclosed tag will create 39 errors, but once that tag has been closed, you'll have say 5 errors. Nicole
_____________________________
|
|
|
|
Nicole
Posts: 2830 Joined: 9/15/2004 From: Nambucca / Kempsey, Australia Status: offline
|
RE: confussed css beginer using fp02 - 8/27/2005 21:19:24
Another question you ask is: "If you have to hand code everything then why use FP??" I hand code mostly, but i still do it in FP02. I find FP easy to view what i'm doing when I'm doing it, and another reason is that I'm just used to it. It may seem tedious at first to go back and recode a page after you think you've created it using FP. But, by taking out all the unnecessary code FP adds itself, and taking all other styles out of the code of each page and putting it in an external style sheet, you'll find that it's far easier to make a simple change across many pages at once, i.e. you won't have to go into each page individually to change a font colour or size etc. You'll be able to change it once in your style sheet and it'll automatically change across your whole site. Also, with your other question, where arre you putting the link to your style sheet? It should go in the <head> of your code, i usually place it as the last item before </head> Nicole
_____________________________
|
|
|
|
StevieB
Posts: 80 Joined: 8/11/2005 From: Yuma, AZ USA Status: offline
|
RE: confussed css beginer using fp02 - 8/28/2005 22:14:04
Thanks all! I've tried to apply your knowledge, and come up a little short. Can you please take a look at my latest post?? http://www.frontpagewebmaster.com/m-285247/tm.htm Thank You! Steve
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|