Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Css class not working in a span

Tags:

html

css

Still learning to work with spans did some debug in the console browser and they are currently not getting the dimensions I gave them in my CSS class. I am just wondering what am I missing so they get the width and height I gave them. Thank you

HTML CODE

<div id="content">        
                <div class="forum-group">
                    <h2 class="header-2">General Discussion</h2>
                    <ul class="child-forums">
                        <li class="child-forum">
                        <a class="forum-link" href="#">
                            <span class="forum-icon"></span>
                            <span class="forum-details">
                                <span class="forum-title"></span>
                                <span class="forum-desc"></span>
                            </span>
                        </a>

CSS CODE

.forum-group{
    width:948px;
    height:259px;    
    margin-left:auto;
    margin-right:auto;
}
.header-2{
    width:948px;
    height:35px;
}
.child-forum{
    width:310px;
    height:106px;
    float:left;
    background-image: url(images/forum-child-background.jpg);
    opacity: 0.5;
    filter: alpha(opacity=50);
    margin-left:4px;
    margin-bottom:4px;
}
.child-forum:hover {
    opacity: 1.0;filter: alpha(opacity=100); 
}
.child-forums{
    width:948px;height:219px;
}
.forum-link{
    width:309px;height:106px;
display: inline-block; 


}
.forum-icon{
    width:60px;height:60px;
}
.forum-details{
    width:220px;height:43px;
}
.forum-title{
    width:217px;height:18px;
}
.forum-desc{
    width:217px;height:15px;
}
like image 669
JeffLA Avatar asked Dec 11 '22 00:12

JeffLA


1 Answers

span elements are inline elements are so are not affected by width and height properties.

Try setting them to display:inline-block and the properties will take effect.

like image 125
Paulie_D Avatar answered Dec 30 '22 23:12

Paulie_D