Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, 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.

Photo

Css Confusion


  • Please log in to reply
3 replies to this topic

#1 webrat

webrat

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:01:51 AM

Posted 08 April 2008 - 06:50 AM

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

BC AdBot (Login to Remove)

 


m

#2 pislkie

pislkie

  • Members
  • 17 posts
  • OFFLINE
  •  
  • Local time:01:51 AM

Posted 08 April 2008 - 12: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:

<!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:

<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<<<

#3 webrat

webrat
  • Topic Starter

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:01:51 AM

Posted 08 April 2008 - 12:54 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:

<!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:

<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

#4 webrat

webrat
  • Topic Starter

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:01:51 AM

Posted 10 April 2008 - 03:43 AM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users