Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help Forums Windows Startup Programs Database Spyware and Malware Removal Guides Computer Tutorials Uninstall Database File Database Computer Glossary Computer Resources
 

Welcome Guest ( Log In | Click here to Register a free account now! )



Register a free account to unlock additional features at BleepingComputer.com
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

 
Reply to this topicStart new topic
> Css Confusion, A problem getting stylesheets to work - at all.
webrat
post Apr 8 2008, 06:50 AM
Post #1


Member
**

Group: Members
Posts: 45
Joined: 8-April 08
Member No.: 201,680



Hey folks,

This is my first post so I'll try and be clear. I'm basically a web junkie (not an IT pro) that started off tweaking SN profiles and has taken the plunge to build a site for stormchasing and related stuff. I thought I would go down the standards compliant route and use xhtml 1.0, build a wireframe frontpage and use stylesheets to see how it went. It didn't.

The xhtml rendered just fine, but the CSS is a no-go whether I use < link rel > or stick it direct in the head. The site is nothing special at this stage but I expected it to at least work based on using in-line CSS for profile tweaks. I'm using T.A Powell 'The Complete Reference: HTML & XHTML' as a source and it's worked ok so far but I'm pretty stumped right now.

Any thoughts would be appreciated.

Cheers

Jason
Go to the top of the page
 
+Quote Post
pislkie
post Apr 8 2008, 12:20 PM
Post #2


Member
**

Group: Members
Posts: 17
Joined: 8-April 08
Member No.: 201,755



Hell, I'm a newby too.

My advice would be to start by using a Document Type Declaration (DTD) that declares HTML 4.01
Much easier with less browser issues. A DTD is essential otherwise browsers adopt a non standards compliant mode refered to as "Quirks Mode".
My favourite DTD is:
QUOTE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


Next, try making a blank page and include a single container (say a div) with text content. apply inline css to both.
When this displays as you intended and it should, transfer the css to an external style sheet referenced in the head of the document using:
QUOTE
<link rel=stylesheet href="stylesheet.css" type="text/css">

Take care to keep the main document and the CSS file on the same level eg both in root directory.

When you have donethis, you have learnt to ride a bike and away you go, next stop Tour de France.


--------------------
>>>piskie<<<
Go to the top of the page
 
+Quote Post
webrat
post Apr 8 2008, 12:54 PM
Post #3


Member
**

Group: Members
Posts: 45
Joined: 8-April 08
Member No.: 201,680



QUOTE(pislkie @ Apr 8 2008, 06:20 PM) *
Hell, I'm a newby too.

My advice would be to start by using a Document Type Declaration (DTD) that declares HTML 4.01
Much easier with less browser issues. A DTD is essential otherwise browsers adopt a non standards compliant mode refered to as "Quirks Mode".
My favourite DTD is:
QUOTE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


Next, try making a blank page and include a single container (say a div) with text content. apply inline css to both.
When this displays as you intended and it should, transfer the css to an external style sheet referenced in the head of the document using:
QUOTE
<link rel=stylesheet href="stylesheet.css" type="text/css">

Take care to keep the main document and the CSS file on the same level eg both in root directory.

When you have donethis, you have learnt to ride a bike and away you go, next stop Tour de France.


Hey Pislkie,

I was using a legit DTD for xtml 1.0 but the 4.01 spec does seem a little more flexible so thanks for that. I still can't get the < link rel > to function as the browser just seems to ignore it. I suspect it has something to do with the directory but I just can't figure it as the filepaths seem correct at a basic level.

However, I can now include the CSS in the head. It seems to be related to the closures used in the reference book I have which differ from the spec used on w3c for html 4.01 (I took a look based on your post). Using these it worked straight away. It may not be full-on but it's logical and tidy which is a great help.

Many thanks,

Jason


Go to the top of the page
 
+Quote Post
webrat
post Apr 10 2008, 03:43 AM
Post #4


Member
**

Group: Members
Posts: 45
Joined: 8-April 08
Member No.: 201,680



Hey folks,

Thought I would stick this in here to avoid starting a new thread as it's kinda related. Just wondered if position: absolute was the most effective/standards compliant method of placing images on-screen?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 30th August 2008 - 09:34 AM


Advertise   |   About Us   |   Terms of Use   |   Privacy Policy   |   Contact Us   |   Site Map   |   Chat   |   Tutorials   |   Uninstall List
Discussion Forums   |   The Computer Glossary   |   Resources   |   RSS Feeds   |   Startups   |   The File Database   |   Malware Removal Guides

© 2003-2008 All Rights Reserved Bleeping Computer LLC.