1、使用div样式给块级数据定义样式
<html>
<head><style>
.cities{
background-color:black;
color:White;
margin:20px;
padding:20px;
}
</style>
</head>
<body>
<div class="cities">
<h2>london</h2>
<p>London is the capital city of England. It is the most populous
city in the United Kingdom, with a metropolitan area of over 13
million inhabitants.
</p>
<p>Standing on the River Thames, London has been a major settlement
for two millennia, its history going back to its founding by the
Romans, who named it Londinium.
</p>
</div>
</body>
</html>
2、定义内联的子窗口
<html>
<head>
</head>
<body>
<iframe src=kove1.js name="love1">love1窗口</iframe>
<a href="http://www.baidu.com" target="love1">love1</a>
</body>
</html>
3、form表单单选框
<html>
<head></head>
<body>
<form >
frist name:
<input type="text" name="firstname" >
second name:
<input type="text" name="secondname" >
favorite food:
<input type="radio" name=fruit value="banana" >banana
<input type="radio" name=fruit value="apple" checked>apple
<input type="radio" name=fruit value="blueberry" >blueberry
<input type="radio" name=fruit value="orange" >orange
<!-- 要通过name属性来确认是在哪几个选项中进行单选,一定要设置name-value属性
-->
</form>
</body>
</html>
4、下拉框选项
<html>
<head>
</head>
<body>
<select name=cars>
<option value="volvo">volvo</option>
<option value="saab">saab</option>
<option value="fiat">fiat</option>
<option value="audi">audi</option>
</select>
</body>
</html>
4、复选框
<html>
<head>
</head>
<body>
<form>
<input type="checkbox" name="fruit" value="banana">i like banana
<br/>
<input type="checkbox" name="fruit" value="apple">i like apple
</form>
</body>
</html>
本文介绍了如何使用HTML的div元素进行块级数据样式定义,包括内联子窗口的创建、form表单中单选框和下拉框的应用,以及复选框的设置,展示了网页布局和交互的基本元素。
2189

被折叠的 条评论
为什么被折叠?



