/    Sign up×
Community /Pin to ProfileBookmark

xhtml vs. html

I’ve been writing HTML for years but have been very lazy about switching to XHTML. I am now biting that bullet and trying write in XHTML.

I have discovered, however, that some CSS I write doesn’t work in XHTML. I can’t see anything wrong with it. Everything is lower case. Everything is properly separated with semi-colons. It works in straight HTML.

Here’s a snippet of test code that doesn’t work.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<!–
–>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<title>This is a test</title>
</head>
<body>
<div id=”chkxhtml” style=”position:absolute;top:200;left:100;background:red;color:white;width:100;height:100;”>
<p>Write stuff here</p>
</div>
</body>
</html>

The positioning doesn’t work and I can’t figure out why. I know I’m missing something, but I can’t find anything on the Net which would direct me to what I am doing wrong.

Thank you for your time.

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@Jeff_MottMay 30.2009 — You need units on your numbers.

200[color=red]px[/color]

100[color=red]px[/color]

And so on.
Copy linkTweet thisAlerts:
@d2coreMay 30.2009 — Jeff Mott is right. you need to tell browser what value u putting their. this is in % or in px/pt or whatever.




Joginder Poswal

www.design2core.com

http://blog.design2core.com
Copy linkTweet thisAlerts:
@J2NYCauthorMay 30.2009 — Thank you so much. That makes perfect sense.
×

Success!

Help @J2NYC spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...