当前位置:懂科普 >

综合知识

> html样式怎么写

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
  • 文章版权属于文章作者所有,转载请注明 https://dongkepu.com/zonghezhishi/yjqol7.html