在HTML5中如何设置屏幕百分比

html-css013

在HTML5中如何设置屏幕百分比,第1张

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>景安</title>

</head>

<style type="text/css">

.head{width: 1000pxheight: 200pxmargin:0 auto}

.head-a{width: 30%height: 200pxbackground: bluefloat: left}

.head-b{width: 70%height: 200pxbackground: orangefloat: right}

</style>

<body>

<div class="head">

<div class="head-a"></div>

<div class="head-b"></div>

</div>

</body>

</html>

我们可以使用width:30%和width:70%这样的形式来设置百分比

style type="text/css">

body,html{margin:0padding:20pxfont-size:12pxfont-family:Arialfont:12px/1 Tahoma, Arial}

.stepOut{height:20pxborder:1px solid #000background:#eeewidth:200pxoverflow:hiddendisplay:none}

.stepIn{width:50pxbackground:#FF0080border-top:1px

solid #FFB5DAborder-bottom:1px solid

#fffoverflow:hiddencolor:#ffftext-align:centerfont:12px/1.6 arial}

</style>

试试看