Unable to align div to right side Flexbox [duplicate] - html

This question already has answers here:
In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?
(6 answers)
Closed 1 year ago.
I'm having a bit of trouble trying to get my interface working
<div class="tier" id="t1">
<div class='title'>
<h3>Tier 1</h3>
<h3 class="price">$5</h3>
</div>
<div class='description'>
<ul>
<li>Soundboard Access</li>
<li>In-Game and Discord tag</li>
<li>VIP and Donator channel access</li>
</ul>
</div>
</div>
<div class="tier" id="t2">
<div class='title'>
<h3>Tier 2</h3>
<h3 class="price">$8</h3>
</div>
<div class='description'>
<ul>
<li><span>All Previous Perks</span></li>
<li>Create a poll once per week</li>
<li>Choose SCP of the Day once per week</li>
</ul>
</div>
</div>
.tier {
border: 1px solid #007eff;
padding: 10px;
margin: 5px;
border-radius: 10px;
display: flex;
}
.title {
margin-top: -10px;
text-align: center;
}
.price {
font-family: monospace;
font-size: 40px;
margin-top: -10px;
margin-bottom: -3px;
padding: 5px;
border-top: 1px solid black;
}
.description {
margin: 3px;
text-align: end;
align-self: flex-end;
}
This is so far what I have, and for the most part it works, but I am struggling to get .description to align to the right.
I read the mozilla docs and I am supposed to be able to use align-self to move it to the end of the div, but that doesn't work. (does absolutely nothing)
Here is what it looks like right now:
Here is somewhat how I'd like it to look:
Any help is appreciated

Apply justify-content:space-between to .tier.
As per MDN:
The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items is the same. The first item is flush with the main-start edge, and the last item is flush with the main-end edge.
.tier {
border: 1px solid #007eff;
padding: 10px;
margin: 5px;
border-radius: 10px;
display: flex;
justify-content: space-between;
}
.title {
margin-top: -10px;
text-align: center;
}
.price {
font-family: monospace;
font-size: 40px;
margin-top: -10px;
margin-bottom: -3px;
padding: 5px;
border-top: 1px solid black;
}
.description {
margin: 3px;
text-align: end;
align-self: flex-end;
}
<div class="tier" id="t1">
<div class='title'>
<h3>Tier 1</h3>
<h3 class="price">$5</h3>
</div>
<div class='description'>
<ul>
<li>Soundboard Access</li>
<li>In-Game and Discord tag</li>
<li>VIP and Donator channel access</li>
</ul>
</div>
</div>
<div class="tier" id="t2">
<div class='title'>
<h3>Tier 2</h3>
<h3 class="price">$8</h3>
</div>
<div class='description'>
<ul>
<li><span>All Previous Perks</span></li>
<li>Create a poll once per week</li>
<li>Choose SCP of the Day once per week</li>
</ul>
</div>
</div>

Related

Flex container not wrapping items [duplicate]

This question already has answers here:
Why are my flex items not wrapping?
(2 answers)
Closed 1 year ago.
I was creating a simple flexbox pricing page for my assignment and I ended up completing it. The problem is that the pricing cards do not wrap to the next row when the screen size is reduced i have set flex-wrap to wrap but still no luck. I searched this problem up and some results said that setting flex-container max-width to 100% would help, but it didn't. I have tried a bunch of other things but to no avail. Can someone help me with this?
CODE
*{
padding: 0px;
margin: 0px;
box-sizing: border-box;
font-family: Poppins, sans-serif;
color: #00255A;
}
.card-container{
display: flex;
height: 80%;
justify-content: space-evenly;
align-items: center;
flex-wrap: wrap;
}
.card{
background-color: white;
width:25%;
height: 70%;
border-radius: 5%;
transition: .5s ease;
border: 3px solid #00255A;
overflow: hidden;
}
.card-heading{
text-align: center;
padding: 15px;
text-transform: uppercase;
border-bottom: 3px dotted #00255A;
margin: 10px;
}
.card-body{
margin-top: 15px;
margin: 2%;
}
.card-price{
width: 60%;
margin: auto;
text-align: center;
margin-top: 10%;
font-size: larger;
}
.card-features{
margin-top: 4%;
}
ul{
text-align: center;
list-style: none;
}
ul li{
padding: 5px;
font-size: small;
font-weight: light;
}
.btn-container{
text-align: center;
margin-top: 10px;
}
.btn-container button{
width:150px;
height: 40px;
background-color: white;
font-weight: bold;
border: 3px solid #00255A ;
transition: .5s ease-out;
}
.recommended{
position: absolute;
background-color: red;
width:150px;
top: 5px;
left:-18px;
transform: rotate(-30deg);
padding-left: 15px;
}
.recommended h4{
font-weight: lighter;
text-transform: uppercase;
color: white;
}
/* Hover Effects */
.btn-container button:hover{
background-color: #00255A;
color: white;
box-shadow: 4px 4px 5px lightgray;
}
.card:hover{
box-shadow: 2px 2px 3px lightgray;
transform: translateY(-5px);
}
<div class="card-container">
<!-- Student Plan Card -->
<div class="card">
<div class="card-heading">
<h3>Student</h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>19.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>15GB Cloud Storage</li>
<li>Upto 5 Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
<!-- Team Plan Card -->
<div class="card" style="height: 80%; position: relative;">
<div class="recommended">
<h4>Popular</h4>
</div>
<div class="card-heading">
<h3>Team</h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>24.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>40GB Cloud Storage</li>
<li>Upto 10 Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
<!-- Business Plan Card -->
<div class="card" >
<div class="card-heading">
<h3>Business </h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>39.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>100GB Cloud Storage</li>
<li>Unlimited Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
</div>
You have to strictly define the width of the cards. 25% is a relative value, meaning it will shrink to the proper size to fit the container. I added some margins for aesthetic reasons, and added a flex: 1 0 0 - it grows if necessary, doesn't shink (if it does it won't wrap), and each card grows from the basis width defined in width. If you don't want it to grow, just define flex:0 0 auto, or just remove the flex line entirely, and define justify-content: space-evenly.
Note that you can hardcode it using media queries as well. In fact, I would recommend that as having different widths for your cards might be troublesome, and creating a pallette of cards of fixed widths would probably be easier.
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
font-family: Poppins, sans-serif;
color: #00255A;
}
.card-container {
margin-top: 20px;
display: flex;
height: 80%;
justify-content: stretch;
align-items: center;
flex-wrap: wrap;
}
.card {
background-color: white;
width: 250px;
flex: 1 0 auto;
margin: 0 50px 20px 50px;
padding-bottom: 20px;
height: 70%;
border-radius: 5%;
transition: .5s ease;
border: 3px solid #00255A;
overflow: hidden;
}
.card-heading {
text-align: center;
padding: 15px;
text-transform: uppercase;
border-bottom: 3px dotted #00255A;
margin: 10px;
}
.card-body {
margin-top: 15px;
margin: 2%;
}
.card-price {
width: 60%;
margin: auto;
text-align: center;
margin-top: 10%;
font-size: larger;
}
.card-features {
margin-top: 4%;
}
ul {
text-align: center;
list-style: none;
}
ul li {
padding: 5px;
font-size: small;
font-weight: light;
}
.btn-container {
text-align: center;
margin-top: 10px;
}
.btn-container button {
width: 150px;
height: 40px;
background-color: white;
font-weight: bold;
border: 3px solid #00255A;
transition: .5s ease-out;
}
.recommended {
position: absolute;
background-color: red;
width: 150px;
top: 5px;
left: -18px;
transform: rotate(-30deg);
padding-left: 15px;
}
.recommended h4 {
font-weight: lighter;
text-transform: uppercase;
color: white;
}
/* Hover Effects */
.btn-container button:hover {
background-color: #00255A;
color: white;
box-shadow: 4px 4px 5px lightgray;
}
.card:hover {
box-shadow: 2px 2px 3px lightgray;
transform: translateY(-5px);
}
<div class="card-container">
<!-- Student Plan Card -->
<div class="card">
<div class="card-heading">
<h3>Student</h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>19.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>15GB Cloud Storage</li>
<li>Upto 5 Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
<!-- Team Plan Card -->
<div class="card" style="height: 80%; position: relative;">
<div class="recommended">
<h4>Popular</h4>
</div>
<div class="card-heading">
<h3>Team</h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>24.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>40GB Cloud Storage</li>
<li>Upto 10 Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
<!-- Business Plan Card -->
<div class="card">
<div class="card-heading">
<h3>Business </h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>39.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>100GB Cloud Storage</li>
<li>Unlimited Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
</div>
You can view it in full screen and resize the browser to see how the wrapping works.
You have set the with of the card to 25%. You'll need to add a media query (https://wiki.selfhtml.org/wiki/CSS/Media_Queries) so you can set another with when the screen is too small.
.card{
width: 50%;
}
#media (min-width: 1200px){
.card{
width: 30%
}
}
Use hard code for width to wrap else you can use #media for different screen sizes if you want to use soft code .
Add margin and padding according to need
#media like this :
#media (max-width: 776px){
.card {
width: 48%;
margin: 2% 1%;
}
}
#media (max-width: 500px){
.card {
width: 90%;
margin: 2% auto;
}
}
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
font-family: Poppins, sans-serif;
color: #00255A;
}
.card-container {
display: flex;
height: 80%;
justify-content: space-evenly;
align-items: center;
flex-wrap: wrap;
}
.card {
background-color: white;
width: 300px;
height: 70%;
margin: 5px; /*Add according to need*/
border-radius: 5%;
transition: .5s ease;
border: 3px solid #00255A;
overflow: hidden;
}
.card-heading {
text-align: center;
padding: 15px;
text-transform: uppercase;
border-bottom: 3px dotted #00255A;
margin: 10px;
}
.card-body {
margin-top: 15px;
margin: 2%;
}
.card-price {
width: 60%;
margin: auto;
text-align: center;
margin-top: 10%;
font-size: larger;
}
.card-features {
margin-top: 4%;
}
ul {
text-align: center;
list-style: none;
}
ul li {
padding: 5px;
font-size: small;
font-weight: light;
}
.btn-container {
text-align: center;
margin-top: 10px;
}
.btn-container button {
width: 150px;
height: 40px;
background-color: white;
font-weight: bold;
border: 3px solid #00255A;
transition: .5s ease-out;
}
.recommended {
position: absolute;
background-color: red;
width: 150px;
top: 5px;
left: -18px;
transform: rotate(-30deg);
padding-left: 15px;
}
.recommended h4 {
font-weight: lighter;
text-transform: uppercase;
color: white;
}
/* Hover Effects */
.btn-container button:hover {
background-color: #00255A;
color: white;
box-shadow: 4px 4px 5px lightgray;
}
.card:hover {
box-shadow: 2px 2px 3px lightgray;
transform: translateY(-5px);
}
<div class="card-container">
<!-- Student Plan Card -->
<div class="card">
<div class="card-heading">
<h3>Student</h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>19.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>15GB Cloud Storage</li>
<li>Upto 5 Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
<!-- Team Plan Card -->
<div class="card" style="height: 80%; position: relative;">
<div class="recommended">
<h4>Popular</h4>
</div>
<div class="card-heading">
<h3>Team</h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>24.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>40GB Cloud Storage</li>
<li>Upto 10 Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
<!-- Business Plan Card -->
<div class="card">
<div class="card-heading">
<h3>Business </h3>
</div>
<div class="card-body">
<div class="card-price">
<h1>39.99/mo</h1>
</div>
<div class="card-features">
<ul>
<li>24/7 Live Support</li>
<li>100GB Cloud Storage</li>
<li>Unlimited Users</li>
</ul>
</div>
</div>
<div class="btn-container">
<button>Buy Now!</button>
</div>
</div>
</div>

CSS property to allow div to grow to full height of parent element

I have a component that has tabs (categories that can be expanded) and then lists (which appear to the right) - I've been really struggling with one aspect of the behaviour:
How can I allow list-container to "grow/expand" to the full height of container - so that the top of list always renders horizontally level with the first heading-tab?
Here's a screenshot of the issue:
I'm actually using Styled Components with React, so the code snippet below is an attempt to replicate the DOM behaviour (array is mapped through and snippet (component) is returned for each item in array)
.container {
display: flex;
}
.heading-tab {
display: flex;
justify-content: space-between;
align-items: center;
max-height: 72px;
width: 360px;
border-top: 1px solid lightgrey;
}
.heading-text {
padding-top: 22px;
padding-bottom: 22px;
padding-left: 32px;
margin-bottom: 0px;
font-size: 16px;
}
.list-container{
display: flex;
width: 100%;
height: auto;
overflow-y: auto;
}
.panel-container{
position: absolute;
}
<div class="container">
<div class="heading-tab">
<p class="heading-text">Heading One</p>
</div>
</div>
<div class="container">
<div class="heading-tab">
<p class="heading-text">Heading Two</p>
</div>
</div>
<div class="container">
<div class="heading-tab">
<p class="heading-text">Heading Three</p>
</div>
<div class="list-container">
<div class="panel-container">
<ul>
<li>List items</li>
<li>List items</li>
<li>List items</li>
</ul>
</div>
<div>
</div>
Codepen: https://codepen.io/simoncunningham/pen/mdwMgyL

Placing items horizontally on Page [duplicate]

This question already has answers here:
Text floating in block next to image
(6 answers)
Closed 2 years ago.
I am new to html + css and I can't seem to figure out how you place items horizontally despite reading a couple articles. What I am going for is having two lines of text on the right side of my image. Currently I have everything placed vertically.
Html:
#content {
max-width: 640px;
margin: 0 auto;
padding: 64px 24px;
}
.section {
padding-bottom: 48px;
margin-bottom: 48px;
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.section:last-of-type {
border-bottom: 0;
padding-bottom: 0;
margin-bottom: 0;
}
.img {
width: 200px;
height: 200px;
border-radius: 40px;
margin-bottom: 12px;
}
```
<body>
<div id="content">
<div class="section">
<img src="Images/Logo.png" class="img">
<h1>Placeholder</h1>
<h2>Placeholder 2</h2>
</div>
<div class="section">
<h6>Projects</h6>
<ul>
<li>
<h3>Placeholder</h3>
<p> Placeholder </p>
</li>
<li>
<h3>Placeholder </h3>
<p> Placeholder </p>
</li>
</ul>
</div>
</div>
</body>
I am not sure if I am sharing everything I need too, Here's the GitHub repo with all the code if you need it.
You can use display: flex; property.
/* ↓ new styling ↓ */
.section-horizontal {
display: flex;
}
.description {
margin-left: 32px;
}
/* your styling */
#content {
max-width: 640px;
margin: 0 auto;
padding: 64px 24px;
}
.section {
padding-bottom: 48px;
margin-bottom: 48px;
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.section:last-of-type {
border-bottom: 0;
padding-bottom: 0;
margin-bottom: 0;
}
.img {
width: 200px;
height: 200px;
border-radius: 40px;
margin-bottom: 12px;
}
<div id="content">
<div class="section section-horizontal"> <!-- class for flexbox -->
<img src="Images/Logo.png" class="img">
<div class="description"> <!-- add this block to align headings vertically -->
<h1>Placeholder</h1>
<h2>Placeholder 2</h2>
</div>
</div>
<div class="section">
<h6>Projects</h6>
<ul>
<li>
<h3>Placeholder</h3>
<p> Placeholder </p>
</li>
<li>
<h3>Placeholder </h3>
<p> Placeholder </p>
</li>
</ul>
</div>
</div>
try to get in touch with the flex property. It will make things alot more simple :)
html:
<body>
<div id="content">
<div class="section">
<img src="Images/Logo.png" class="img">
<div class="flex">
<h1>Placeholder</h1>
<h2>Placeholder 2</h2>
</div>
</div>
</div>
</body>
css:
.flex {
display: flex;
}
You can do with flexbox like this
#content {
max-width: 640px;
margin: auto;
padding: 64px 24px;
display:flex;
flex-wrap:wrap;
justify-content: space-evenly;
}
.section {
padding-bottom: 48px;
margin-bottom: 48px;
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.section:last-of-type {
border-bottom: 0;
padding-bottom: 0;
margin-bottom: 0;
}
.img {
width: 200px;
height: 200px;
border-radius: 40px;
margin-bottom: 12px;
}
<body>
<div id="content">
<div class="section">
<img src="Images/Logo.png" class="img">
<h1>Placeholder</h1>
<h2>Placeholder 2</h2>
</div>
<div class="section">
<h6>Projects</h6>
<ul>
<li>
<h3>Placeholder</h3>
<p> Placeholder </p>
</li>
<li>
<h3>Placeholder </h3>
<p> Placeholder </p>
</li>
</ul>
</div>
</div>
</body>

Why is this <div> containing previous div? [duplicate]

This question already has answers here:
What is a clearfix?
(10 answers)
What methods of ‘clearfix’ can I use?
(29 answers)
Closed 3 years ago.
I have a problem where the top <div> element appears to be containing the <div> above it, although the source code would indicate that this should not be the case. An image of this effect is below, and you can see that my horizontal header seems to be contained in the same <div> as the <div> containing the "place" <h2> tag, but it is not and this should not be happening.
Here is the HTML for this section:
<div class="tabSection">
<div class="tabDiv">
<ul class="tabsList">
<li class="tabItem"><i class="fas fa-globe-europe"></i>Places</li>
<li class="tabItem"><i class="fas fa-skiing"></i>Activities</li>
<li class="tabItem"><i class="fas fa-info-circle"></i>More Info</li>
<li class="tabItem"><i class="fas fa-phone-alt"></i>Contact Us</li>
</ul>
</div>
<div id="placeTabBody" class="tabBody">
<h2 class="tabHeader">Place</h2>
</div>
<div id="activitiesTabBody" class="tabBody">
<h2 class="tabHeader">Activities</h2>
</div>
<div id="moreInfoTabBody" class="tabBody">
<h2 class="tabHeader">More Information</h2>
</div>
<div id="contactUsTabBody" class="tabBody">
<h2 class="tabHeader">Contact Us</h2>
</div>
</div>
</div>
And here is the CSS:
.tabsList {
list-style: none;
margin-left: 10px;
display: block;
}
.tabsList li {
display: block;
float: left;
font-size: 18pt;
width: 155px;
cursor: pointer;
margin-right: 18px;
margin-top: 20px;
border-bottom: 2px solid #e84118;
transition: 0.3s;
}
.tabsList li:hover {
border-color: #44bd32;
}
.tabsList li i {
margin-right: 7px;
}
.tabBody {
display: block;
background-color: red;
width: 100%;
margin: 10px 0 10px 10px;
}
Please help!
It seems a missing float clearing.
Add height: auto and overflow:hidden to .tabsList
.tabsList {
list-style: none;
margin-left: 10px;
display: block;
height: auto;
overflow: hidden;
}

Divs do not float properly

I am just trying to float these 3 divs to the left, so that they are all in one line. But whenever I apply float left to the id=abkitchen, it just does not float. I think it's because I've got a fixed header at the top of the page. Any idea how to do so that they float properly? Thanks in advance.
HTML:
<div id="headnav">
<ul>
<li>The Act</li>
<li>Kitchen Act</li>
<li>Social Act</li>
</ul>
</div>
<div id="logo"><img src="images/logo.png"></div>
<div id="filters">
<div class="section" id="utensils">
<ul>
<li>HANDS<input type="checkbox" name="hands" value=".hands" id="hands"><label for="hands"></label></li>
<li>FORK<input type="checkbox" name="fork" value=".fork" id="fork"><label for="fork"></label></li>
</ul>
</div>
<div class="section" id="food">
<ul>
<li><input type="checkbox" name="burger" value=".burger" id="burger"><label for="burger">BURGER</label></li>
<li><input type="checkbox" name="cupcake" value=".cupcake" id="cupcake"><label for="fork">CUPCAKE</label></li>
</ul>
</div>
</div>
<div id="abkitchen"><p><em>Kitchen Act</em> is an exploration presenting a series of videos that investigate the interaction people have with everyday utensils. By pairing everyday food with an unexpected utensil, for instance, a burger with chopsticks, these interactions aim to foster an appreciation towards these tools that are often considered secondary to food. By establishing that utensils are the bridge between us and our food, these videos assert that utensils play a defining role in our experience of a meal.</p></div>
CSS:
#headnav{
z-index:101;
position: absolute;
top: 0px;
height: 35px;
width: 100%;
background: #f9f9f9;
text-align: left;
font-size: 1em;
overflow: hidden;
padding: 0.35em 0.5%;
vertical-align: middle;
}
#headnav ul{
display:inline-block;
list-style-type:none;
margin:auto 0;
padding:8px;
}
#headnav li{
display:inline;
padding-right:10px;
margin-top:10px;
font-size: 14px;
}
#logo{
float:left;
padding:15px;
}
#abkitchen{
background-color: #E0E0E0;
padding:15px;
text-align: left;
width:50%;
}
#filters{
text-align: left;
padding:15px;
/*background-color: white;*/
}
#utensils, #food{
display: inline-block;
float:left;
width:auto;
height:auto;
background-color: yellow;
}
#utensils{
text-align: right;
padding-top: 15px;
padding-left: 15px;
padding-bottom: 15px;
}
#food{
padding-top: 15px;
padding-right: 15px;
padding-bottom: 15px;
margin-left: -5px;
}
li{
list-style-type: none;
}
First of all - you have a typo in #utensils, #food{, you need float:left;
Second of all, you need to set float property to ALL elements that you need to float.
Start simple, and make three divs that float, and work from there.
Next problems that you will encounter would be - your divs move down. You need to set the width for all of them, and then encapsulate them all in a bigger div. And after all of the floating divs, I personally put one empty div that just has clear: both; in it.
Observe:
<div style="width: 381px; border: 1px solid #000000;">
<div style="float: left; width: 125px; border: 1px solid #FF0000;">
I am RED!!!
</div>
<div style="float: left; width: 125px; border: 1px solid #00CC00;">
I am Green!!!
</div>
<div style="float: left; width: 125px; border: 1px solid #0000FF;">
I am Blue!!!
</div>
<div style="clear: both;"></div>
</div>
<div style="border: 1px solid #000000;">And my behaviour is completely unacceptable!</div>
This way you make sure the elements stay in place no matter how much you resize the window...
I think you should just add "clearfix".
Here's the HTML:
<div id="logo"><img src="images/logo.png"></div>
<div id="filters">
<div class="section" id="utensils">
<ul>
<li>HANDS<input type="checkbox" name="hands" value=".hands" id="hands"><label for="hands"></label></li>
<li>FORK<input type="checkbox" name="fork" value=".fork" id="fork"><label for="fork"></label></li>
</ul>
</div>
<div class="section" id="food">
<ul>
<li><input type="checkbox" name="burger" value=".burger" id="burger"><label for="burger">BURGER</label></li>
<li><input type="checkbox" name="cupcake" value=".cupcake" id="cupcake"><label for="fork">CUPCAKE</label></li>
</ul>
</div>
</div>
<div id="abkitchen"><p><em>Kitchen Act</em> is an exploration presenting a series of videos that investigate the interaction people have with everyday utensils. By pairing everyday food with an unexpected utensil, for instance, a burger with chopsticks, these interactions aim to foster an appreciation towards these tools that are often considered secondary to food. By establishing that utensils are the bridge between us and our food, these videos assert that utensils play a defining role in our experience of a meal.</p></div>
<div class="clearfix"></div>
And the CSS code:
#logo{
float:left;
padding:15px;
}
#abkitchen{
background-color: #E0E0E0;
padding:15px;
text-align: left;
width:50%;
}
#filters{
text-align: left;
padding:15px;
/*background-color: white;*/
}
#utensils, #food{
display: inline-block;
float;left;
width:auto;
height:auto;
background-color: yellow;
}
#utensils{
text-align: right;
padding-top: 15px;
padding-left: 15px;
padding-bottom: 15px;
}
#food{
padding-top: 15px;
padding-right: 15px;
padding-bottom: 15px;
margin-left: -5px;
}
li{
list-style-type: none;
}
.clearfix{
clear: both;
}
I hope it works fine.
Try to be more specific when you say "three divs"...
Anyway, i suggest you start by adding your divs with minimum content and some basic CSS. When this works, start adding content and more CSS.
HTML
<div id="logo">
<p>this is logo</p>
</div>
<div id="filters">
<p>this is filters</p>
</div>
<div id="abkitchen">
<p>this is abkitchen</p>
</div>
CSS:
#logo,
#filters,
#abkitchen {
float: left;
padding: 20px;
border: 1px solid #eee;
}