Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

H1 element not sitting correctly in IE

Posted on 2007-11-15
4
Medium Priority
?
211 Views
Last Modified: 2009-12-16
i cant get my page title to sitr correctly in IE.  please see examples:  

http://www.seandelaney.co.uk/ee/screenshot-2.png //  Firefox browser using error.css
http://www.seandelaney.co.uk/ee/screenshot-1.png // IE browser using error.css & ie-hacks.css

i have been playing about with different hacks but i cant get it to sit the way i want it to sit - like it does in Firefox...

Please advise
error.css
--------------------
 
div#error
{
	margin-top:0px;
	border-left:1px solid #C8C8C8;
	border-right:1px solid #C8C8C8;	
	clear:both;
	background:#FFFFFF;
	color:#202020;
}
 
div#error h1,
div#error h2
{
	background:#FFFFFF;
	margin-top:10px;
	margin-bottom:10px;
	font-family:"Trebuchet MS";
	font-size:1.2em;
	padding-left:10px;
	float:left;
	width:98%;
}
 
div#error p
{
	margin:0px;
	line-height:150%;
	padding-left:10px;
	padding-top:0px;
	padding-bottom:15px;
	padding-right:10px;
}
 
 
ie-hacks.css
------------------------
div#header h1
{
	width:98%;
}
 
div#error h1
{
	position:relative;
	margin:0px;
	padding-top:10px;
	padding-bottom:10px;
}
 
div#error h1,
div#error h2
{
	width:97%;
}
 
a
{
	cursor:hand; 
}
 
 
HTML code
---------------------------
 
<div id="error">
	<h1>404 Not Found</h1>
	<h2>Cause</h2>
	<p>The 404 Not Found error is an <acronym title="Hypertext Transfer Protocol">HTTP</acronym> status code that means that the page you were trying to reach could not be found on the web site&#39;s server.</p>
	<h2>Resolution</h2>
	<p>Retry the web page by clicking the refresh/reload button or trying the <acronym title="Uniform Resource Locator">URL</acronym> from the address bar again.</p>
</div>

Open in new window

0
Comment
Question by:ellandrd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:rucky544
ID: 20287782
I'm not sure why you need hacks to get a Heading to display correctly.

Just set all margins and padding, set a font size and set positioning to relative.

You should remove the float left, i can't really see what that is supposed to be doing and it won't be helping!
0
 
LVL 16

Author Comment

by:ellandrd
ID: 20287790
well as you can see it firefox it sits correctly - the exact same code wont in IE... i cant figure out why its does this....
0
 
LVL 5

Accepted Solution

by:
rucky544 earned 2000 total points
ID: 20287797
try doing what i suggested...

"Just set all margins and padding, set a font size and set positioning to relative.

You should remove the float left, i can't really see what that is supposed to be doing and it won't be helping!"

You really souldn't need a hack for a simple page like that.

I'm sure it must be the floating left part!
0
 
LVL 18

Expert Comment

by:Eternal_Student
ID: 20288000
I agree, it is almost certainly the float:left part not getting cleared that is causing this.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question