|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Zealot
![]() ![]() Join Date: Mar 2005
Posts: 113
|
IE: a display block
I was playing around with some css files to compare them in the browsers and notice that IE doesn't support the a and hover display block that contain the link inside. Is there a hack or solution to address this problem?
css: Code:
#testbox {
background-color: #00CC00;
width: 200px;
}
#test a {
padding: 2px;
display: block;
}
#test a:hover {
background-color: #CC3300;
}
Code:
<dl id="testbox"> <dt id="test"><a href="#">test1</a></dt> </dl> <div id="testbox"> <div id="test"><a href="#">test1</a></div> </div> |
|
|
|
|
|
#2 |
|
SitePoint Wizard
![]() ![]() Join Date: Nov 2004
Location: Åsnorrbodarna
Posts: 11,777
|
Try this:
Code:
#test a {
display: block;
width: 100%;
}
|
|
|
|
|
|
#3 |
|
SitePoint Zealot
![]() ![]() Join Date: Mar 2005
Posts: 113
|
Thanks! It works. I tweaked the width 100% to 98% due to the padding to prevent the display from being expand 2px outward, just curious is there better approach when deal with padding and 100% width situation?
HTML Code:
#test a {
display: block;
padding: 2px;
width: 98%;}
|
|
|
|
|
|
#4 |
|
CSS Advisor
![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 27,436
|
Hi,
You can use the height:1% hack to force the whole area to be active. Code:
/* mac hide \*/
* html #test a {height:1%}
/* end hide */
You should never really mix percentage and pixels as they will never add up to exactly what you want. ![]() |
|
|
|
|
|
#5 | |
|
SitePoint Wizard
![]() ![]() Join Date: Nov 2004
Location: Åsnorrbodarna
Posts: 11,777
|
Quote:
HTML Code:
<a href="#"><span>Link text</span></a> Code:
a {
display:block;
width:100%;
}
a span {
padding:0 2px;
}
|
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:47.













Linear Mode
