简体   繁体   中英

css styles aren't applied on classes

I'm trying to create a social card (similar to Facebook). I don't know why I can't modify my classes inside CSS, but when I style them directly they work.

 .card { display: inline-block; width: 600px; height: 145px; }.image-section { width: 130px; display: inline-block; }.image { width: 90px; vertical-align: middle; border-radius: 90px; }.name { font-size: 55px; }
 <div class=”card”> <div class=”image-section”> <img class=”image” src="images/photo.png"> </div> <div class=”info-section”> <p class=”name”>Roland</p> <p class=”tag”>@roland00</p> <p class=”gender”>Male</p> </div> <div class=”button-section”> <button class=”btn” type=”button”>Follow</button> </div> </div>

Now its applying you have mistake in your double inverted comma.

 .card { display: inline-block; width: 600px; height: 145px; }.image-section { width: 130px; display: inline-block; }.image { width: 90px; vertical-align: middle; border-radius: 90px; }.name { font-size: 55px; }
 <div class="card"> <div class="image-section"> <img class="image" src="images/photo.png"> </div> <div class="info-section"> <p class="name">Roland</p> <p class="tag">@roland00</p> <p class="gender">Male</p> </div> <div class="button-section"> <button class="btn" type="button">Follow</button> </div> </div>

when naming the classes in html use this class="name" instead of class=”card”

I can see only one reasons: You put css styling tag after the html code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM