婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > HTML+css盒子模型案例(圓,半圓等)“border-radius” 簡單易上手

HTML+css盒子模型案例(圓,半圓等)“border-radius” 簡單易上手

熱門標簽:智能電銷機器人廣告語 貴陽ai外呼系統 強訊外呼系統 重慶人工智能電銷機器人報價 電銷外呼線路改不外呼線路 crm外呼系統好不好 愛巢地圖標注 電話機器人批發 長春極信防封電銷卡公司

很多小伙伴在前端學習的時候,發現盒子模型默認為正方形。如何把盒子變成想要的模型呢? 首先我們來看一下默認的情況----

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: rgb(116, 51, 51);
            box-shadow:0 10px 10px red;
            text-align: center;
            position:absolute;
            margin:0 auto;   
            left:0;
            right:0;
            bottom:0;
            top:0;

        }
    </style>
    <title>Document</title>
</head>
<body>
    <div class="box">

    </div>
</body>
</html>

默認情況下為正方形,也許小伙伴覺得不太好看。 我們換成圓形的試試!

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .box{
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: rgb(28, 99, 60);
            border: 5px solid rgb(55, 0, 255);
            position: absolute;
            margin: 0 auto;
            left: 0;
            right: 0;
            bottom: 0;
            top: 0;
        }
    </style>
    <title>Round</title>
</head>
<body>
    <div class="box">

    </div>
</body>
</html>

看一下我們變成了圓形! 來看看半圓形的吧!

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .box{
            width: 100px;
            height: 50px;
            background-color: rgb(175, 42, 216);
            border: 3px solid rgb(26, 236, 26);
            border-top-right-radius: 50px;
            border-top-left-radius: 50px;
            position:absolute;
            margin: 0 auto;
            left: 0;
            right: 0;
            bottom: 0;
            top: 0;
        }
    </style>
    <title>semicircle</title>
</head>
<body>
    <div class="box">

    </div>
</body>
</html>

來試試其他形狀!

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: rgb(82, 84, 223);
            border-radius: 20px 15px 20px 10px;
            position: absolute;
            margin: 0 auto;
            left: 0;
            bottom: 0;
            right: 0;
            top: 0;
        }
    </style>
    <title>demo</title>
</head>
<body>
    <div class="box">

    </div>
</body>
</html>

知識點分析:

border-radius:給元素設置圓角邊框
可以實現圓,半圓,橢圓,四分之一圓等各種圓角圖形。
可以設置四個值,分別為左上,右上,右下,左下
給個口訣,“從左上開始順時針移動”。。。

希望這篇文章能讓你學會border-radius屬性!

到此這篇關于HTML+css盒子模型案例(圓,半圓等)“border-radius” 簡單上手的文章就介紹到這了,更多相關html css盒子模型內容請搜索腳本之家以前的文章或繼續瀏覽下面的相關文章,希望大家以后多多支持腳本之家!

標簽:內蒙古 山南 上海 保定 清遠 廣安 吳忠 陜西

巨人網絡通訊聲明:本文標題《HTML+css盒子模型案例(圓,半圓等)“border-radius” 簡單易上手》,本文關鍵詞  HTML+css,盒子,模型,案例,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《HTML+css盒子模型案例(圓,半圓等)“border-radius” 簡單易上手》相關的同類信息!
  • 本頁收集關于HTML+css盒子模型案例(圓,半圓等)“border-radius” 簡單易上手的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 大田县| 光泽县| 通州市| 望奎县| 昌乐县| 裕民县| 桑日县| 肇源县| 衢州市| 瑞安市| 即墨市| 丹凤县| 中方县| 安新县| 康定县| 淄博市| 通渭县| 乃东县| 盖州市| 沁源县| 喜德县| 元阳县| 汉中市| 襄垣县| 青神县| 诸城市| 微山县| 类乌齐县| 刚察县| 镇宁| 钦州市| 巫溪县| 称多县| 孙吴县| 民勤县| 团风县| 林周县| 奈曼旗| 庄河市| 含山县| 若羌县|