Css查漏补缺11-层模型小实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>层模型小实例</title> <style> .img_box{ width: 400px; height: 300px; border: 1px solid transparent; margin: 30px auto; position: relative; } .img_item{ width: 400px; height: 300px; } .author{ position:absolute; left: 10px; top: 10px; background-color: orange; } .lesson_num{ position:absolute; right: 10px; top: 10px; background-color: #ff4f81; } .label { display: inline; padding: .2em .6em .3em; font-size: 16px; font-weight: 700; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } </style> </head> <body> <div class="img_box"> <img class="img_item" src="../Html5学习\cjf.png" alt=""> <div class="info_box"> <div class="label author">Everything</div> <div class="label lesson_num">***</div> </div> </div> </body> </html>