Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set parallel DIVs?

Tags:

html

css

I want to have 3 aligned parallel to each other. I have seen few examples over internet but somehow they are not working for me. My html file is follows:

<!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=iso-8859-1" />
<script type="text/css">
 #root {
    background-color: #eee;
}

#left_side {
    float: left;
}

#center_s {
    margin-left: auto;
    margin-right: auto;
    width: 65px;
    background-color: #ccc;
}

#right_side {
    float: right;
}


</script>

</head>

<body>

<div id="root">
    <div id="left_side">LEFT</div>
    <div id="right_side">RIGHT</div>
    <div id="center_s">CENTER</div>
</div>



</body>
</html>

Thanks :)

like image 976
Dhruv Avatar asked Sep 18 '25 23:09

Dhruv


1 Answers

not script. write style instead of script. there is syntax error. like this.

<style type="text/css">
 #root {
   background-color: #eee;
 }

#left_side {
float: left;
 }

#center_s {
margin-left: auto;
margin-right: auto;
width: 65px;
background-color: #ccc;
}

#right_side {
float: right;
}


</style>
like image 173
AliRıza Adıyahşi Avatar answered Sep 21 '25 15:09

AliRıza Adıyahşi