如何设置HTML5 标签的样式

html-css07

如何设置HTML5 标签的样式,第1张

<p style="color: red">第一种方式</p> <style>

    .aa {

        color: red

    }

</style>

<p class="aa">第二种方式</p>

html5 css3样式图标制作方法:

1、html代码:

<div id="boxes">

<div id="boxShortcode">border-radius: 40px (shortcode)</div>

<div id="box1">border-top-right-radius: 40px (same on both axis)</div>

<div id="box2">border-top-right-radius: 20px 40px (x <y) </div>

<div id="box3">border-top-right-radius: 40px 20px (x >y) </div>

</div>

2、css样式代码:

#boxes div { margin-bottom: 20pxheight: 50pxpadding-left: 20px }

#boxShortcode {

background: cyan

border-radius: 40px

}

#box1 {

background: red

border-top-right-radius: 40px

}

#box2  {

background: yellow

border-top-right-radius: 20px 40px

}

#box3 {

background: lime

border-top-right-radius: 40px 20px

}

3、运行结果:

我估计你没有将代码写道服务器上,或者在服务器上,但是没有启动服务器。

在本地电脑上(没有启动tomcat等服务器)写的HTML页面,若是应用的是外部样式文件,那么网页加载html时,不会自动加载外部样式文件的,

但外部的JavaScript文件是可以执行的,是不是很奇怪啊?

如下代码:

<html>

<head>

<title>无标题文档</title>

<!-- 下面引入的js会加载 -->

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

<!-- 下面引入的css文件不会加载 -->

<link type="text/css" href="outStyle.css" />

</head>

<body>

<div class="main">

</div>

</div>

</body>

</html>