Tabbed content with equal height - html

I'm trying to achieve a tabbed menu that displays content which is displayed in a block. I can achieve this using just padding but I want each block to be the same height, I tried using flexbox but couldn't seem to get it to work. How can I achieve that?
.tab-pane {
flex: 1;
padding: 80px;
}
.nav-tabs {
border-bottom: none;
display:block;
}
.nav-tabs li a {
text-decoration:none;
}
.jj-icon {
max-width: 50px;
padding-bottom: 20px;
}
.bg-blue {
background-color: blue;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container pt-200">
<div class="row">
<div class="col-6">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#home">Title 1</a></li>
<li><a data-toggle="tab" href="#menu1">Title 2 </a></li>
<li><a data-toggle="tab" href="#menu2">Title 3</a></li>
</ul>
</div>
<div class="col-6">
<div class="tab-content d-flex flex-column">
<div id="home" class="tab-pane justify-content-center bg-blue active">
<img src="images/marketing.svg" class="jj-icon">
<h3>Menu</h3>
<p>Sed vel erat ultrices, facilisis metus et, tincidunt turpis. Aenean nec lorem finibus, ornare ex sit amet, tempus nunc. Proin feugiat rhoncus nibh vel laoreet.</p>
</div>
<div id="menu1" class="tab-pane justify-content-center bg-blue fade">
<img src="images/marketing.svg" class="jj-icon">
<h3>Menu 1</h3>
<p>Faucibus, vitae posuere felis molestie. Integer vulputate euismod libero, ac dignissim arcu aliquam id. In hac habitasse platea dictumst.</p>
</div>
<div id="menu2" class="tab-pane justify-content-center bg-blue fade">
<img src="images/marketing.svg" class="jj-icon">
<h3>Menu 2</h3>
<p>Fusce sagittis urna nec ultrices rutrum. In tristique mi non tellus vulputate, nec luctus diam porttitor. Nulla porttitor sagittis placerat.</p>
</div>
</div>
</div>
</div>
</div>
Here's how I want it to look:

Is this the basic design pattern you are looking for?
#topBar,#bottomBar{
height:10vh;
width:100vw;
background-color:black;
}
#middleContainer{
display:flex;
justify-contents:center;
width:100vw;
height:80vh;
background-color:white;
}
body{
margin:0;
}
#left,#right{
display:flex;
flex-direction:column;
align-items:center;
width:50%;}
p{
border:solid 2px green;
}
#right,#left{
border:solid 2px red;
}
#big{
width:90%;
height:90%;
}
<div id='topBar'>
</div>
<div id='middleContainer'>
<div id='left'>
<p>title 1</p>
<p>title 2</p>
<p>title 3</p>
</div>
<div id='left'>
<p id='big'>some text</p>
</div>
</div>
<div id='bottomBar'>
</div>

Bootstrap comes with buil-in class for display , margin, padding , ...
flex box can be imbricated: possible example :
.tab-pane {
flex: 1;
padding: 80px;
}
.nav-tabs {
border-bottom: none;
display:block;
}
.nav-tabs li a {
text-decoration:none;
}
.jj-icon {
max-width: 50px;
padding-bottom: 20px;
}
.bg-blue {
background-color: blue;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container pt-200">
<div class="row">
<div class="col-6 d-flex">
<ul class="nav nav-tabs d-flex flex-column w-100 m-0 p-0 align-items-center justify-content-center">
<li class="active p-0 m-2"><a data-toggle="tab" href="#home">Title 1</a></li>
<li class=" p-0 m-2"><a data-toggle="tab" href="#menu1">Title 2 </a></li>
<li class=" p-0 m-2"><a data-toggle="tab" href="#menu2">Title 3</a></li>
</ul>
</div>
<div class="col-6">
<div class="tab-content d-flex flex-column">
<div id="home" class="tab-pane justify-content-center bg-blue active">
<img src="images/marketing.svg" class="jj-icon">
<h3>Menu</h3>
<p>Sed vel erat ultrices, facilisis metus et, tincidunt turpis. Aenean nec lorem finibus, ornare ex sit amet, tempus nunc. Proin feugiat rhoncus nibh vel laoreet.</p>
</div>
<div id="menu1" class="tab-pane justify-content-center bg-blue fade">
<img src="images/marketing.svg" class="jj-icon">
<h3>Menu 1</h3>
<p>Faucibus, vitae posuere felis molestie. Integer vulputate euismod libero, ac dignissim arcu aliquam id. In hac habitasse platea dictumst.</p>
</div>
<div id="menu2" class="tab-pane justify-content-center bg-blue fade">
<img src="images/marketing.svg" class="jj-icon">
<h3>Menu 2</h3>
<p>Fusce sagittis urna nec ultrices rutrum. In tristique mi non tellus vulputate, nec luctus diam porttitor. Nulla porttitor sagittis placerat.</p>
</div>
</div>
</div>
</div>
</div>

Related

How to flip card in HTML

I am new to webdevelopment and have this issue. For this I created a Codepen
For the 6 cards I wanted to ad an image. When I hover over the image it should swap the card and show content. So when the first three cards swaps it still shows up an image instead of the content as the under the first three cards.
So my idea is: when I hover over an image it should swap the card and show only a white background with content as the under three cards.
Can anyone assist me here on how to do it?
.services .icon-box {
text-align: center;
border: 1px solid #e2eefd;
padding: 80px 20px;
transition: all ease-in-out 0.3s;
}
.services .icon-box .icon {
margin: 0 auto;
width: 64px;
height: 64px;
background: #f1f6fe;
border-radius: 4px;
border: 1px solid #deebfd;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
transition: ease-in-out 0.3s;
}
.services .icon-box .icon i {
color: #3b8af2;
font-size: 28px;
transition: ease-in-out 0.3s;
}
.services .icon-box h4 {
font-weight: 700;
margin-bottom: 15px;
font-size: 24px;
}
.services .icon-box h4 a {
color: #222222;
transition: ease-in-out 0.3s;
}
.services .icon-box p {
line-height: 24px;
font-size: 14px;
margin-bottom: 0;
margin-top: 0;
}
.services .icon-box:hover {
border-color: #fff;
box-shadow: 0px 0 25px 0 rgba(16, 110, 234, 0.1);
}
.services .icon-box:hover h4 a, .services .icon-box:hover .icon i {
color: #106eea;
}
.services .icon-box:hover .icon {
border-color: #106eea;
}
.flip-card {
background-color: transparent;
height: 337px;
}
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
}
.align-items-stretch:hover .flip-card-front {
display: none;
}
.flip-card-inner{
width: 100%;
height: 100%;
transition: transform 0.6s;
transform-style: preserve-3d;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
background-size: cover;
background-repeat: no-repeat;
}
.flip-card-front, .flip-card-back {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.flip-card-back {
color: black;
transform: rotateY(180deg);
}
.flip-card:last-child {
margin-bottom: 0;
}
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Roboto:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<section id="services" class="services">
<div class="container" data-aos="fade-up">
<div class="section-title">
<h2>Lorem</h2>
<h3>Lorem <span>.</span></h3>
<p>Praesent in dui nec lorem vulputate hendrerit quis vel nisl. Aenean at auctor augue. Vivamus facilisis pretium suscipit. Praesent nec turpis pellentesque elit iaculis tristique et at justo. Pellentesque feugiat, leo nec rutrum aliquam, dui est pulvinar diam, ut elementum velit nibh vitae ipsum. Morbi id lacinia risus. Etiam faucibus erat ac nibh aliquet laoreet. Sed velit ante, auctor sed imperdiet id, elementum a justo. Nullam condimentum metus vitae porttitor tincidunt.</p>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 d-flex align-items-stretch flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="background-image: url('https://images.unsplash.com/photo-1611095790444-1dfa35e37b52?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1051&q=80');">
<div class="flip-card-front">
<div class="icon"><i class="bx bxs-user-account"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 mt-md-0 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="background-image: url('https://images.unsplash.com/photo-1560732488-6b0df240254a?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80');">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-server"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 mt-lg-0 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="background-image: url('https://images.unsplash.com/photo-1454779132693-e5cd0a216ed3?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1051&q=80');">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-network-chart"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum..</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="text-align: center;">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-world"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="text-align: center;">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-star"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="text-align: center;">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-coin-stack"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
</div>
</div>
</section>
Thank you very much!
You need to hide the image when you show the back of the card. The easiest way to your given code is to set the size of the background to 0.
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
background-size: 0; /* Added to hide the background image. */
}

Header overlay over Hero

I am working on a website. I am a little rusty when it comes to CSS. I am trying to get the same effect as this page https://prp.fm/. I want the header to be over the hero section with a transparent background. The header does not need to be sticky, but I am unable to get the header to overlay over the header.
I tried adding background-attachment:fixed in the .hero-section CSS, but it would just fix the image to the page and not scroll with the page. That I do NOT want. I want the hero section to be behind the header and scroll with the page.
.main {
padding-top: 0 !important;
}
.header-section {
background: #212121;
padding: 0 33px;
padding-bottom: 50px;
border-bottom: 1px solid #fff;
position: relative:
}
.hero-section {
height: 962px;
background-image: url(../img/chart-bg.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: top center;
padding-top: 0px;
z-index: 100;
}
<header class="header-section" id="header">
<div class="header-warp">
<!-- Site Logo -->
<a href="home.html" class="site-logo">
<img src="img/logo.png" alt="">
</a>
<!-- responsive -->
<div class="nav-switch">
<i class="fa fa-bars"></i>
</div>
</div>
</header>
<div class="main">
<section class="hero-section">
</section>
<div id="inner">
<section class="some-section">
<div class="container">
<div class="section-title text-center">
<h2>Tile</h2>
</div>
<div class="row about-box">
<div class="col-lg-6">
<img src="img/pic1.jpg" alt="">
</div>
<div class="col-lg-6">
<div class="ab-content">
<h4>A short History</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu tincidunt ligula. Fusce dictum ullamcorper purus, at elementum sem sollicitudin non. Sed id tristique lacus. Fusce pellentesque dignissim arcu, id hendrerit urna feugiat vitae.
Pellentesque viverra aliquet arcu, vel aliquet est commodo quis. Nam tempus, nisl eu maximus viverra, magna quam porta nibh.</p>
</div>
</div>
</div>
</div>
</section>
</div>
Just reduce an opacity on the header and increase the font-weight of the contents which are in the header like the following
.main {
padding-top: 0 !important;
}
.header-section {
background: #212121;
padding: 0 33px;
padding-bottom: 50px;
border-bottom: 1px solid #fff;
opacity: .3; /* added */
position: relative:
}
.hero-section {
height: 962px;
background-image: url(../img/chart-bg.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: top center;
padding-top: 0px;
z-index: 100;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<header class="header-section" id="header">
<div class="header-warp">
<!-- Site Logo -->
<a href="home.html" class="site-logo">
<img src="img/logo.png" alt="">
</a>
<!-- responsive -->
<div class="nav-switch">
<i class="fa fa-bars"></i>
</div>
</div>
</header>
<div class="main">
<section class="hero-section">
</section>
<div id="inner">
<section class="some-section">
<div class="container">
<div class="section-title text-center">
<h2>Tile</h2>
</div>
<div class="row about-box">
<div class="col-lg-6">
<img src="img/pic1.jpg" alt="">
</div>
<div class="col-lg-6">
<div class="ab-content">
<h4>A short History</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu tincidunt ligula. Fusce dictum ullamcorper purus, at elementum sem sollicitudin non. Sed id tristique lacus. Fusce pellentesque dignissim arcu, id hendrerit urna feugiat vitae.
Pellentesque viverra aliquet arcu, vel aliquet est commodo quis. Nam tempus, nisl eu maximus viverra, magna quam porta nibh.</p>
</div>
</div>
</div>
</div>
</section>
</div>

Why does a row inside a fluid container overflow on the x-axis?

I am adding a footer to my website. When I add it it makes the website overflow on the x-axis. Removing the 15px margins in the .row isn't an option because i would have to redo all the css
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<footer style="margin-top:20px;background-color:lightgrey">
<div class="container-fluid" style="max-width:100%; margin:0px">
<div class="row" style="margin:0px;width:100%">
<div class="col-8" style="padding-bottom:10px !important; padding:40px">
<h4 style="margin-top: 10px">Om</h4>
<p class="text-muted" style="margin-top:7px">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum placerat malesuada leo. Vestibulum rutrum erat non diam feugiat pulvinar.
Nam sit amet aliquam nibh. Vestibulum sed consequat elit. Ut sodales justo sit amet iaculis venenatis. Curabitur fermentum magna id nunc ullamcorper consectetur.
Cras quis odio quis elit aliquet vulputate in nec nulla. Donec placerat bibendum ligula eget fringilla. Quisque sem ligula, sodales at est vitae, consectetur tempor justo.
</p>
</div>
<div class="col-2" style="padding-bottom:10px !important;padding:40px">
<h4 style="margin-top: 10px">Hurtige links</h4>
<li style="list-style-type: none;">
Upload
</li>
<li style="list-style-type: none;">
Min profil
</li>
<li style="list-style-type: none;">
Hjem
</li>
</div>
<div class="col-2" style="padding-bottom:10px !important;padding:40px; padding-left: 0px !important">
<h4 style="margin-top: 10px">Ligegyldige links</h4>
<li style="list-style-type: none;">
Betingelser
</li>
</div>
</div>
</div>
<div class="container-fluid" style="width:100%">
<div class="row" style="width:100%;background-color:lightgrey">
<div class="col-12" style="padding-top:0px !important;padding-bottom: 0px !important;padding:40px">
<hr>
<p>Copyright © 2019 All Rights Reserved by Studii</p>
</div>
</div>
</div>
</footer>
container-fluid was originally taken out of Bootstrap 3.0, but added
back in 3.1.1
To fix this, you can either:
Use the newer version of Bootstrap style sheet
Demo with New Style Sheet in Fiddle Or add in the class yourself
The .row adds a 15px margin to the left and right. Since
.container-fluid fills up 100% of the screen width, the extra margin
space causes overflow issues.
To fix this, you need to add padding to .container-fluid class
.container-fluid {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
Demo with Custom container class in Fiddle

Bootstrap 3.0's row have margin-left 15px and margin-right 15px

<header>
<div class="container">
<div class="row">
<div class="col-lg-2 logo">
<img src="img/logo.png" alt="Logotype">
</div>
<div class="col-lg-7 col-lg-offset-3">
<ul class="menu">
<li class="menu-item">Home</li>
<li class="menu-item">About</li>
<li class="menu-item">Expertise</li>
<li class="menu-item">Teams</li>
<li class="menu-item">Works</li>
<li class="menu-item">People say</li>
<li class="menu-item">Contact</li>
</ul>
</div>
</div>
</div>
<div class="row text-center content-wrapper">
<div class="col-lg-12 content-header">
<h1 class="title">We Are Awesome Creative Agency</h1>
<p class="description-header">
This is Photoshop's version of Lorem Ipsum. Proin gravida nibh vel velit auctor aliquet. Aenean sollicitudin, lorem<br> quis bibendum auctor, nisi elit consequat ipsum, nec sagittis sem nibh id elit. Duis sed odio sit amet nibh<br> vulputate cursus
a sit amet mauris. Morbi accumsan ipsum velit.
</p>
<div class="button">
<a class="content-button">LEARN MORE</a>
</div>
</div>
</div>
</header>
I recently started to learn Bootstrap and faced with such a problem, why when I create a he has a margin left / right 15px, the width of my screen 1263px, because these fields seem to have horizontal scrolling, after 1293px fields,and so each new row, how to solve this problem?
Just my template
Screenshoot my console
Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding. You must give 1263px width to the container and inside that you should use rows to avoid horizontal scrolling.
Container element will have a padding of 15px on left and right. Rows will have negative margin of 15px on both left and right side, which will compansate the space used(for padding) by the container. So that your rows will appear 100% on your screen and avoids horizantal scrolling.
Try margin-left: 0px; and margin-right: 0px. Then set it to margin: 0 auto and change width to width: 100%. This might help it, if not, I may need a snippet of your code to fiddle around with it.
<header>
<div class="container">
<div class="row">
<div class="col-lg-2 logo">
<img src="img/logo.png" alt="Logotype">
</div>
<div class="col-lg-7 col-lg-offset-3">
<ul class="menu">
<li class="menu-item">Home</li>
<li class="menu-item">About</li>
<li class="menu-item">Expertise</li>
<li class="menu-item">Teams</li>
<li class="menu-item">Works</li>
<li class="menu-item">People say</li>
<li class="menu-item">Contact</li>
</ul>
</div>
</div>
<div class="row text-center content-wrapper">
<div class="col-lg-12 content-header">
<h1 class="title">We Are Awesome Creative Agency</h1>
<p class="description-header">
This is Photoshop's version of Lorem Ipsum. Proin gravida nibh vel velit auctor aliquet. Aenean sollicitudin, lorem<br> quis bibendum auctor, nisi elit consequat ipsum, nec sagittis sem nibh id elit. Duis sed odio sit amet nibh<br> vulputate cursus
a sit amet mauris. Morbi accumsan ipsum velit.
</p>
<div class="button">
<a class="content-button">LEARN MORE</a>
</div>
</div>
</div>
</div>
</header>

Trouble forcing text to wrap

I am attempting to put several messages in a thread-like layout. To see the result of what I have, go here: http://jsfiddle.net/sunjay03/Aykqc/embedded/result/
If you adjust the width of the screen, you will see that the text in the lower message does not layout properly. As well as that, I can't seem to get the date to always go to the very right of the screen.
Here is the link to the full jsfiddle: http://jsfiddle.net/sunjay03/Aykqc/
Here are some images of what I'd like to happen:
Any help?
I fiddled around with your fiddle and made this of it:
http://jsfiddle.net/S7drj/1/
HTML:
<div class="messages">
<div class="message">
<div class="message-image">
<img src="http://www.sunjay.ca/images/logo_notext.gif" alt="profile_image">
</div>
<div class="message-body">
<div class="message-name">
<span class="message-date">Nov. 15, 2010</span>
<h3>John Smith</h3>
</div>
<div class="message-text">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
</div>
<div class="message">
<div class="message-image">
<img src="http://www.sunjay.ca/images/logo_notext.gif" alt="profile_image">
</div>
<div class="message-body">
<div class="message-name">
<span class="message-date">Nov. 15, 2010</span>
<h3>Joe Smith</h3>
</div>
<div class="message-text">
<p>Aliquam commodo dui at mauris tempus eu commodo nunc commodo. Quisque accumsan semper sapien, quis tristique odio egestas ac.</p>
</div>
</div>
</div>
</div>
CSS:
body
{
margin: 20px;
}
.message
{
padding: 2px;
margin: 2px;
clear: both;
width:100%;
}
.message .message-image
{
padding: 5px;
float:left;
}
.message .message-body
{
}
.message .message-body .message-name
{
}
.message .message-body .message-name h3
{
}
.message .message-body .message-text
{
}
.message .message-body .message-date
{
float: right;
}
Is that how you want it?
How's this jsFiddle?
HTML:
<div class="container">
<div class="name">John Smith</div>
<div class="date">Nov. 15, 2010</div>
<div class="content">Aliquam commodo dui at mauris tempus eu commodo nunc commodo. Quisque accumsan semper sapien, quis tristique odio egestas ac.</div>
</div>
<div class="container">
<div class="name">John Smith</div>
<div class="date">Nov. 15, 2010</div>
<div class="content">Aliquam commodo dui at mauris tempus eu commodo nunc commodo. Quisque accumsan semper sapien, quis tristique odio egestas ac.</div>
</div>
<div class="container">
<div class="name">John Smith</div>
<div class="date">Nov. 15, 2010</div>
<div class="content">Aliquam commodo dui at mauris tempus eu commodo nunc commodo. Quisque accumsan semper sapien, quis tristique odio egestas ac.</div>
</div>
CSS:
.name {
float:left;
}
.date {
float:right;
}
.content {
clear:both;
}
.container {
overflow:auto;
padding-left:115px;
background: url(http://www.sunjay.ca/images/logo_notext.gif) no-repeat;
min-height: 110px;
margin-bottom: 20px;
}