CSS experts can you help me to implement a css file that gives me this design.
Asked
Active
Viewed 47 times
2 Answers
0
Either give more specifications, or here it is:
.left {
max-width: 150px;
background-color: red;
display: inline-block;
vertical-align: top;
}
.right {
background-color: blue;
display: inline-block;
vertical-align: top;
}
<div class="page">
<div class="left">
<div style="border:1px solid black; margin-bottom:5px;">Photo</div>
<div style="border:1px solid black; ">Div 3</div>
</div>
<div class="right">
<div style="border:1px solid black; margin-bottom:5px;">Div 1</div>
<hr>
<div style="border:1px solid black;">Div 2</div>
<div style="border:1px solid black;">Div 4</div>
</div>
</div>

jbutler483
- 24,074
- 9
- 92
- 145

Alexey
- 3,607
- 8
- 34
- 54
-
-
-
[Here's just a few reasons...](http://stackoverflow.com/questions/2612483/whats-so-bad-about-in-line-css) but wait, [there seems to be a few more reasons here...](http://robertnyman.com/2008/11/20/why-inline-css-and-javascript-code-is-such-a-bad-thing/). Hang on, [I can do this too](http://bit.ly/1xy9ZAW) – jbutler483 Mar 25 '15 at 11:50
-
Not a single out points out the bad thing about what I did. The question was to show something that resembles his question. I did. What had to be in a css file was put there, the margin and borders are not even needed in the file as I am sure they will be removed. – Alexey Mar 25 '15 at 12:06
0
Here is something, that can help. http://jsfiddle.net/mf36nLrt/
.photo, .div3{
width: 75px;
height: 90px;
border: 1px solid #d5d5d5;
float: left;
}
.div1, .div2, .hr, .div4 {
float: left;
width: calc(100% - 85px); /* Here 85 is the width of PHOTO + margin + border */
margin-left: 5px; /*Adjust this value for the space between photo and DIV#1 */
border: 1px solid #d5d5d5;
height: 50px;
}
.hr{
border: none;
border-bottom: 1px solid #d5d5d5;
margin-top: 5px;
height: 0px;
}
.div2{
margin-top: 5px;
height: 30px;
}
.div3{
margin-top: 5px;
}
.div4{
height: 90px;
margin-top: 5px;
}
<div>
<div>
<div class="photo"></div>
<div class="div1"></div>
<div class="hr"></div>
<div class="div2"></div>
</div>
<div>
<div class="div3"></div>
<div class="div4"></div>
</div>
</div>

Pugazh
- 9,453
- 5
- 33
- 54