當前位置:編程學習大全網 - 電腦編程 - css中怎麽將壹個標簽樣式設成與另壹個壹樣

css中怎麽將壹個標簽樣式設成與另壹個壹樣

1.用同壹個類名。如:

css代碼:

.box{ width:100px; height:100px; background-color:red;}

html代碼:

<div class="box">我是div</div>

<h1 class="box">我是h1</h1>

<p class="box">我是p</p>

2.不同的選擇器用,隔開,如:

css代碼:

.box,.box1,#box2{ width:100px; height:100px; background-color:red;}

html代碼:

<div class="box">我是div</div>

<h1 class="box1">我是h1</h1>

<p id="box2" 我是p</p>

  • 上一篇:臺州路橋大型數控機床對外加工廠在哪裏
  • 下一篇:廣數928eat系統中,G71和G72的詳細格式是什麽?
  • copyright 2024編程學習大全網