HTML+CSS Easy to Start Box Model Border (Part 1)
The border of the box model is the line surrounding the content and filler. You can set the thickness, style and color of this line (three attributes of the border).
The following code:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>邊框</title> <style type="text/css"> p{ border:1px solid red; /*也可分開(kāi)來(lái)寫(xiě)*/ /* border-width: 1px;*/ /*粗細(xì)*/ /* border-style: solid;*/ /*樣式,實(shí)線(xiàn),虛線(xiàn),等*/ /* border-color: red;*/ /*顏色*/ /* dashed(虛線(xiàn))| dotted(點(diǎn)線(xiàn))| solid(實(shí)線(xiàn)) 小伙伴們可以試一下*/ } </style> </head> <body> <p> 我的世界因?yàn)橛心悴艜?huì)美 我的天空因?yàn)橛心悴粫?huì)黑 給我快樂(lè)為我傷心流眼淚 給我寬容能讓我展翅高飛 你的話(huà)你的淚 你的笑你的美 在我眼中勝過(guò)最美的玫瑰 抱著夢(mèng)往前飛 不逃避不后退 你是我成功路上的堡壘! 給我翅膀 讓我可以翱翔 給我力量 是你讓我變堅(jiān)強(qiáng) 不怕受傷 因?yàn)橛心阍谏砼?nbsp; 你的笑你的淚 是我逐夢(mèng)路上最美的太陽(yáng) </p> </body> </html>
The color can be written in hexadecimal #ccc #f60 etc.
The width in border-width (border width) can also be set to:
thin | medium | thick (but not very commonly used), pixels (px) are most commonly used