Solved

Simple CSS Question

Posted on 2008-06-23
9
174 Views
Last Modified: 2010-04-09
Hi All,

I have the below in CSS file which simply positions the block of html code at the bottom of the browser.
It works great in Firefox but not in Internet Explorer. Why?

#footer {
position: fixed; left: 0; bottom: 0; width: 100%; height: 25px; padding: 2px;
background: red; font-family:arial, helvetica, sans-serif; font-size: 10pt;
color:white; vertical-align: center;
}

Html code:

<DIV id=footer>
<TABLE  border=0 ALIGN="left" width=100% cellpadding=0 cellspacing=2>
<TR class=bg_col>
<TD ALIGN="left"><img ...></TD>
<TD ALIGN="center"><img ...></TD>
<TD ALIGN="right"><img ....></TD>
</TR>
</TABLE>
</div>

Thanks
0
Comment
Question by:aarch1
9 Comments
 
LVL 17

Assisted Solution

by:ram_0218
ram_0218 earned 25 total points
ID: 21849644
position:absolute ??
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 21849736
IE doesn't usually play nice when it comes to positioning. So I would either use posiiton:relative; or position: absolute;...but just remember you may need to hack it for IE. Let me know if you do.

Thanks,
Brad
0
 

Author Comment

by:aarch1
ID: 21850035
Thanks for the quick response.

I forgot to mention one more point. I also have a body tag set in css (inline stylesheet) which makes the body to scroll(see overflow: auto;)  and keep the text at the bottom of the browser fixed.

position:absolute/relative does not work.

IE:
If I use position:absolute, after the fixed text rest of the body content is displayed.

If I use position:relative, after all the body content, fixed text is displayed.

What I want is

1)
some text
.
.
.
fixed text

2) display scroll bar so see some more text.

Thanks for you help.
0
 
LVL 7

Assisted Solution

by:Brad Dobyns, CSM
Brad Dobyns, CSM earned 450 total points
ID: 21850929
Are you doing your CSS for IE like this:

_position:relative; (for IE6)
.position:relative; (for IE7)

Thanks,
Brad
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 21850940
I will be home later and can look at this more closely. Can you send me the page's code including the <body> so I can see what is going on and what is being used by the CSS? Do you have a link I can see?

Thanks,
Brad
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 25 total points
ID: 21851480
as I said in another thread, overflow is a M$ HACK for trying to fix position and display problems in IE6 and 7.  Using overfolw:auto will guarantee you have NO IDEA what IE is fudging to fix its bad programming.

Remove overflow:auto completely -- only then can you debug the positioning problem.  If you don't get rid of their hacks, you're not likely to figure out the problem.
0
 
LVL 7

Accepted Solution

by:
Brad Dobyns, CSM earned 450 total points
ID: 21851862
Well, based on the code you gave us at first, if you were to use this code:

#footer {
            position: fixed;
            _position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 25px;
            padding: 2px;
            background: red;
            font-family:arial, helvetica, sans-serif;
            font-size: 10pt;
            color:white;
            vertical-align: center;
      }

that will do what you need it to do. As far as the overflow:auto issue, thats should be removed in order to see what other issues are in store for IE. As it was explained to me once, IE doesn't play nice with complex codes and will only respond to simple coding.

Thanks,
Brad
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 21866971
Why the B? What was wrong with the answer? I thank you for the points but why the B grade?
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 21868606
don't take it personally.  I get lots of B grades when my input solved the question.  It is just something people do, I wouldn't worry.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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…

912 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now