第01步:编写css样式:class_01.css
@charset "utf-8"; /* CSS Document */ div.class01{ background-color:#9F0; color:#FFF }
第02步: 编写html界面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>类选择器应用</title> <link href="class_01.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="class01"> 调用了class_01.css里面的class01样式 </div> </body> </html>
时间: 2024-10-11 00:02:43