madmatter23
Jan 24th, 2009, 05:47 AM
Hello,
I'm having some trouble with display: inline;
SITUATION:
Without it using the property, everything "works" fine. But, I need to display a couple of these "working" list items on the same line and in the center of their parent div.
PROBLEM:
As far as I know, using inline display is the only way to do this, but once I assign the property, everything goes crazy. Overflow:hidden; breaks, which causes the widths and heights to go all wrong, etc.
GOAL:
I need to find a way to display the two elements li.group to be displayed inline and centered without screwing everything else up.
PLEA:
Can anyone please tell me if there is something wrong with my code and if there is a way to achieve the desired goal? I would really appreciate the help. Thank you.
CODE:
relevant css:
#groups {
margin: 10px;
}
.group {
position: relative;
width: 130px;
height: 290px;
overflow: hidden;
margin: 40px auto;
background: #444444;
border: 5px solid;
border-color: #444444;
padding: 0;
display: inline;
}
.group_title {
position: relative;
top: 90px;
color: white;
font-size: 1.3em;
text-align: center;
background: #444444;
}
.group_link {
margin: 0;
padding: 0;
border: none;
color: white;
text-decoration: none;
}
.group_img {
position: absolute;
top: 0;
left: -20px;
margin: 0;
padding: 0;
border: none;
}
relevant html:
<div id="groups">
<ul>
<li class='group'>
<p class='group_title'>2008</p>
<a href='group.php?exid=1' class='group_link'>
<img src='/medium_1/exhibition_1/ex_mids/paul.jpg' alt='' class='group_img'/>
</a>
</li>
<li class='group'>
<p class='group_title'>2007</p>
<a href='group.php?exid=2' class='group_link'>
<img src='/medium_1/exhibition_2/ex_mids/2007.jpg' alt='' class='group_img'/>
</a>
</li>
</ul>
</div>
Without display: inline; (http://www.stephenshaheen.com/groups.php?medium_id=1)
With display: inline; (http://www.stephenshaheen.com/groups1.php?medium_id=1)
Turning off or removing all JavaScript has no effect. I don't think it's the source of the problem.
I'm having some trouble with display: inline;
SITUATION:
Without it using the property, everything "works" fine. But, I need to display a couple of these "working" list items on the same line and in the center of their parent div.
PROBLEM:
As far as I know, using inline display is the only way to do this, but once I assign the property, everything goes crazy. Overflow:hidden; breaks, which causes the widths and heights to go all wrong, etc.
GOAL:
I need to find a way to display the two elements li.group to be displayed inline and centered without screwing everything else up.
PLEA:
Can anyone please tell me if there is something wrong with my code and if there is a way to achieve the desired goal? I would really appreciate the help. Thank you.
CODE:
relevant css:
#groups {
margin: 10px;
}
.group {
position: relative;
width: 130px;
height: 290px;
overflow: hidden;
margin: 40px auto;
background: #444444;
border: 5px solid;
border-color: #444444;
padding: 0;
display: inline;
}
.group_title {
position: relative;
top: 90px;
color: white;
font-size: 1.3em;
text-align: center;
background: #444444;
}
.group_link {
margin: 0;
padding: 0;
border: none;
color: white;
text-decoration: none;
}
.group_img {
position: absolute;
top: 0;
left: -20px;
margin: 0;
padding: 0;
border: none;
}
relevant html:
<div id="groups">
<ul>
<li class='group'>
<p class='group_title'>2008</p>
<a href='group.php?exid=1' class='group_link'>
<img src='/medium_1/exhibition_1/ex_mids/paul.jpg' alt='' class='group_img'/>
</a>
</li>
<li class='group'>
<p class='group_title'>2007</p>
<a href='group.php?exid=2' class='group_link'>
<img src='/medium_1/exhibition_2/ex_mids/2007.jpg' alt='' class='group_img'/>
</a>
</li>
</ul>
</div>
Without display: inline; (http://www.stephenshaheen.com/groups.php?medium_id=1)
With display: inline; (http://www.stephenshaheen.com/groups1.php?medium_id=1)
Turning off or removing all JavaScript has no effect. I don't think it's the source of the problem.