문제

Example given below

 <div id="SocialMediaBadges">

    <a href="http://www.facebook.com/liftedattire">
        <img src="facebook.png"/>
    </a>
    <a href="http://www.twitter.com/liftedattire">
        <img src="twitter.png"/>
    </a>
    <a href="http://www.instagram.com/liftedattire">
        <img src="instagram.pdf"/>
    </a>

</div>

and then have css align them up with something like this? I've tried the code but unfortunately, it didn't work. I can code them individually but this seemed a lot more efficient.

#SocialMediaBadges {
   float:left;
   width:120px;
   height:90px;
   margin:5px; 
}
도움이 되었습니까?

해결책

Try this:

#SocialMediaBadges img{
    float:left;
    width:120px;
    height:90px;
    margin:5px; 
}

Working example

Note: if you want to address an element inside an element you can do it by appending elements in the css rule.

For example #id_name div p a will address all the links that are inside a p element nested in div element that also nested in element with id = id_name

다른 팁

try this

#SocialMediaBadges a img{
    float:left;
    width:120px;
    height:90px;
    margin:5px; 
}

also you cant put pdf in html <img src="instagram.pdf"/>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top