Hi,
How could I align all divs at once in dreamweaver? I have more than 50 divs, and I want to change the alignments for them all at once, let we say "center" how could I do that especially I'm using the fluid grids layout.
Thanks.
Well, I'm doing something like this now, so I'll take a shot at it, and then we can wait for expert comments.
<head>
<style>
.manydivs {
background-color:black;
margin-top:10px;
margin-left:auto;
margin-right:auto;
margin-bottom:10px;
border:1px solid black;}
</style>
</head>
<body>
<div class="manydivs">Yoyoyo</div>
<div class="manydivs">Yoyoyo</div>
<div class="manydivs">Yoyoyo</div>
<div class="manydivs">Yoyoyo</div>
<div class="manydivs">Yoyoyo</div>
</body>
Just by changing the style section, all of them will change.
You can assign other sub-behaviors with other methods.
Do you have a class assigned to these 50 divs at the moment? If you do, you can add a selector to align all these individually. If they're independent of each other, you could put them within a container and propagate to all child divs using pseudo-classes in CSS.
We'd be able to advice better if we're able to see your page. Can you share the URL with us?
Add these styles shown in green to your basic.css file and you'll see that your page is, in fact centered.
body {background: maroon}
.gridContainer {
background: white;
margin-left: auto;
margin-right: auto;
width: 87.9666%;
padding-left: 1.5166%;
padding-right: 1.5166%;
}
I think the problem is that you don't have enough floated divisions to fill-up your desktop display.
Nancy O.
One more thing to add to your Basic.css. This will put a dotted border around every div inside your .gridContainer so you can see what's happening with your layout.
.gridContainer >div {
border:1px dotted green;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
I often develop my pages with borders until I'm ready to publish the site.
Hope this helps you, too.
Nancy O.
North America
Europe, Middle East and Africa
Asia Pacific