開心生活站

位置:首頁 > 綜合知識 > 

html樣式怎麼寫

1. HTML css 樣式 下面的樣式如何寫

<ul>

html樣式怎麼寫

<li><img src=""/><a href="#">;文字文字文字<span>;焦點圖</span><span>2014-6-19</span></a></li>

<li><img src=""/><a href="#">;文字文字文字<span>;焦點圖</span><span>2014-6-19</span></a></li>

<li><img src=""/><a href="#">;文字文字文字<span>;焦點圖</span><span>2014-6-19</span></a></li>

</ul>

ul,li{margin:0;padding:0;}

ul{width:200px;}

li{display:block;float:left;height:80px;border-bottom:1px solid #999;padding:10px 0;}

img{border:0;float:left;width:80px;height:80px;margin-right:5px;}

a{display:inline-block;}

span{display:block;color:#ccc;}

2. 如何在html 標籤中直接寫樣式

更改HTML標籤中的行內樣式,首先需要確認的是要修改標籤的所在位置,然後想好所要改的css樣式,在行級中的style標籤後面去書寫就可以了,具體看下代碼:

<html>

<head>

</head>

<body>

<div id="round" style="width:400px;">; //通過行級樣式來編寫這個div的width和height

<p>;我是測試文字</p>

</div>

</body>

</html>

3. CSS樣式都有哪幾種

大小 font-size: x-large;(特大) xx-small;(極小) 一般中文用不到,只要用數值就可以,單位:PX、PD、em等

樣式 font-style: oblique;(偏斜體) italic;(斜體) normal;(正常)

行高 line-height: normal;(正常) 單位:PX、PD、EM

粗細 font-weight: bold;(粗體) lighter;(細體) normal;(正常)

色彩background-color: #FFFFFF;

圖片background-image: url();border-style: dotted;(點線) dashed;(虛線) solid;(實線) double;(雙線) groove;(凹槽) ridge;(脊狀) inset;(邊框) outset;(邊框)

類型list-style-type: disc;(圓點) circle;(圓圈) square;(方塊) decimal;(數字) none(無)text-align:right; /*文字右對齊*/

text-align:left; /*文字左對齊*/

text-align:center; /*文字居中對齊*/

text-align:justify; /*文字分散對齊*/

vertical-align屬性

vertical-align:top; /*垂直向上對齊*/

vertical-align:bottom; /*垂直向下對齊*/

vertical-align:middle; /*垂直居中對齊*/

vertical-align:text-top; /*文字垂直向上對齊*/

vertical-align:text-bottom; /*文字垂直向下對齊*/這些都是比較常用的如果你要把樣式做的很漂亮這些還是不夠的自己去看看文檔吧慢慢學習

4. css樣式 怎麼寫

手寫了一個例子:

<html>

<head>

<style type="text/css">

.fl {float:left;}

.top .fl {width:28%; text-align:left;background-color:red;}

</style>

</head>

<body>

<div class="top">

<span class="fl">fl</span>

</div>

<br />

<span class="fl">fl</span>

</body>

</html>

效果如圖,第一個span是包含在div裏的(div 的class爲top),爲了能看清楚,加了紅色的背景。可以看出,紅色部分正好是頁面寬度的28%(371px/1366px約等於28%)。而第二個,沒有包含在div裏的span,沒有紅色背景,顯然是不受.top .fl {width:28%; text-align:left;background-color:red;}影響。。。當然咯,你自己測試的時候可以加上.top{***********},體會體會。。。不懂的話,追問咯 ^_^

5. 如圖中的html+css樣式應該怎麼寫

<html>

<head>

<meta charset=utf-8">

<style type="text/css">

.tab{

width: 520px;

height: 25px;

background-color: darkorange;

color: white;

font-family: simhei;

}

td{

width: 50px;

}

</style>

</head>

<body>

<table class="tab" >

<tr>

<td rowspan=3></td>

<td></td>

<td>;首頁</td>

<td>;尋找</td>

<td>

<select style="background-color: darkorange;color: #ffffff;">

<option>;場地</option>

<option>;沙灘</option>

<option>;小樹林</option>

<option>;別墅裏</option>

</select>

</td>

<td>;發佈</td>

<td>;需求</td>

</tr>

</table>

</body>

</html>

代碼運行圖:

如有問題,我們繼續交流。

希望能夠幫助到你,望採納!

6. HTML css 樣式 下面的樣式如何寫

文字文字文字焦點圖2014-6-19文字文字文字焦點圖2014-6-19文字文字文字焦點圖2014-6-19ul,li{margin:0;padding:0;}ul{width:200px;}li{display:block;float:left;height:80px;border-bottom:1px solid #999;padding:10px 0;}img{border:0;float:left;width:80px;height:80px;margin-right:5px;}a{display:inline-block;}span{display:block;color:#ccc;}。

7. html select 標籤 css 樣式怎麼寫

select 可以定義size就是大小

<style type="text/css">

<!--

.select * {

margin: 0;

padding: 0;

}

.select {

border:1px solid #cccccc;

float: left;

display: inline;

}

.select div {

border:1px solid #f9f9f9;

float: left;

}

/* 子選擇器,在FF等非IE瀏覽器中識別 */

.select>div {

width:120px;

height: 17px;

overflow:hidden;

}

/* 通配選擇符,只在IE瀏覽器中識別 */

* html .select div select {

display:block;

float: left;

margin: -2px;

}

.select div>select {

display:block;

width:124px;

float:none;

margin: -2px;

padding: 0px;

}

.select:hover {

border:1px solid #666666; //鼠標移上的效果

}

.select select>option {

text-indent: 2px; //option在FF等非IE瀏覽器縮進2px

}

-->

</style>

</head>

<body><div class="select">

<div>

<select>

<option>;看見效果了吧</option>

<option>;看見效果了吧</option>

<option>;看見效果了吧</option>

</select>

</div>

</div>

你看看這段代碼中對select的設置

8. html中怎麼編寫css,格式是什麼樣的

樣式語法:Selector {property:value}

如何將樣式表加入您的網頁:

你可以用以下三種方式將樣式表加入您的網頁。而最接近目標的樣式定義優先權越高。高優先權樣式將繼承低優先權樣式的未重疊定義但覆蓋重疊的定義。例外請參閱!important聲明。

內聯方式 Inline Styles

內聯定義即是在對象的標記內使用對象的style屬性定義適用其的樣式表屬性。

示例代碼:

這一行的字體顏色將顯示爲紅色

內部樣式塊對象 Embedding a Style Block

你可以在你的HTML文檔的標記裏插入一個塊對象。

示例代碼:

body{background:#fff;color:#000;}

p{font-size:14px;}

外部樣式表 Linking to a Style Sheet

你可以先建立外部樣式表文件*.css,然後使用HTML的link對象。

示例代碼:

標籤:html