使用 Bootstrap 为图像添加样式
Bootstrap 提供以下类来为图像添加样式
- .img-rounded − 添加 border-radius:6px 为图片添加圆角
- .img-circle − 通过添加 border-radius:500px. 使整个图像变为圆形
- .img-thumbnail − 添加少量填充和灰色边框
您可以尝试运行以下代码为图像添加样式
示例
<!DOCTYPE html> <html> <head> <title>Bootstrap Images</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <p>Styling images with Bootstrap</p> <img src = "/bootstrap/images/download.png" class = "img-rounded"> <img src = "/bootstrap/images/download.png" class = "img-circle"> <img src = "/bootstrap/images/download.png" class = "img-thumbnail"> </body> </html>
广告