Damn, I always feel frustated with CSS. I keep reading books and articles/tuturials but CSS is a PITA!
I've the following code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing CSS</title>
<style type="text/css">
<!--
body {
background: #dddddd;
font: 12px "Trebuchet MS", Helvetica, sans-serif;
color: #000;
}
.box {
background: #FFF;
width: 500px;
border: 1px solid #999999;
-moz-border-radius: 5px;
}
.box .content {
background: #FFF;
padding: 15px;
-moz-border-radius: 5px;
}
.message {
border: 1px solid #bbbbbb;
padding: 10px;
margin: 0px 0px 15px;
background-color: #DDDDDD;
color: #333333;
-moz-border-radius: 5px;
}
.message.info {
border-color: #9FD1F5;
background-color: #C3E6FF;
color: #005898;
}
._50\% {
display: inline;
float: left;
margin: 0 2%;
overflow: hidden;
position: relative;
width: 46%;
}
-->
</style>
</head>
<body>
<div class="box">
<div class="content">
<div class="message info">Info message.</div>
<div class="message _50%">Simple message.</div>
<div class="message _50%">Simple message.</div>
</div>
</div>
</body>
</html>
But no matter what I do I can't seem to get the two "Simple Messages" to display side by side, bellow the "Info Message", I already tried playing with display
, overflow
, etc... Nothing seems to work.
What am I missing?