tags:

views:

75

answers:

4

give css for for div , it should be occupy 90% of screen in any size of monitor

+5  A: 

Er...

div { width: 90%; }

or

div { margin: 0 5%; }
ceejayoz
+2  A: 
.myClass{
  width: 90%;
}

<div class="myClass"></div>
gmcalab
+2  A: 
div { position:absolute; left:5%; right:5% }

Test and see...

Alexander
+1 Effective! Even centers it.
amphetamachine
nice got it man..
Ayyappan.Anbalagan
+2  A: 
<head>
    <style type="text/css">
    .myClass{
        width: 90%;
    }
    </style>
</head>
<body>
    <!-- ... -->
    <div class="myClass"></div>
    <!-- ... -->
</body>

Or,

<div style="width: 90%;"></div>

But dude, seriously, check out the W3C's CSS2 reference manual and at least try to find the answer by yourself.

amphetamachine
how make it center allignment
Ayyappan.Anbalagan
+1 for trying to find it yourself.
ceejayoz