/    Sign up×
Community /Pin to ProfileBookmark

The following code displays a div. How do I get the div to display at 5px in height, in IE & FireFox?

[code=html]<?xml version=”1.0″ encoding=”iso-8859-1″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title></title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<style>
body
{
FONT-SIZE: 8pt;
FONT-FAMILY: Verdana;
PADDING: 0px;
MARGIN: 0px;
}

#line
{
TOP: 100px;
LEFT: 100px;
WIDTH: 100px;
PADDING: 0px;
POSITION: absolute;
BORDER: 1px solid rgb(0,0,0);
}</style>
</head>

<body>
<div id=”line”></div>
</div>
</body>
</html>
[/code]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@CentauriJan 17.2008 — [CODE]#line
{
top: 100px;
left: 100px;
width: 100px;
padding: 0px;
position: absolute;
border: 1px solid rgb(0,0,0);
[COLOR="Red"] height: 5px;
font-size: 1px;[/COLOR]
}[/CODE]

Properties should be in lower case, especially when using xhtml doctype.

Also get rid of the xml line before the doctype - that will throw IE into quirks mode.
×

Success!

Help @Dysan 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.20,
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,
)...