I have been designing a responsive website and i have come across this issue.
Firstly, changing from portrait mode to landscape didn't trigger any responsive reactions. It just zoomed into the website. I ensured this doesn't happen with:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
However, when the user change back to portrait mode, a white space appears on the right. Here is a screenshot.
Here is part of the code of the container.
<div class="about">
<div class="container">
<div class="row">
<div class="span12">
<div class="headlines"><h1>Hello..</h1></div>
<div class="row">
<div class="span6">
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
</p>
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
</p>
</div>
<div class="span6">
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
</p>
</div>
</div>
<hr class="soften"/>
<div class="about-hire">
<h3 >Hello?</h3>Let's talk!
</div>
</div>
</div>
</div>
</div>
and this is the corresponding CSS.
.about {
text-align: center;
padding: 100px 0 100px 0;
background-color: #fff;
}
.about .container {
position: relative;
z-index: 9;
}
#media (max-width: 767px) {
.about {
margin-left: -20px;
margin-right: -20px;
}
.about .container {
margin-left: 20px;
margin-right: 20px;
}
}
Any help is greatly appreciated.
I can think of 2 things here:
1.
the scale should be this:
<meta name="viewport" content="width=device-width, initial-scale=1">
2.
Could be your dimensions states...
Add this on your body tag if you don't have it... in your master css:
body {min-width: 100%;}
If you want to be specific you can start with this:
body {min-width: 1024px;}
then add your media code appropiately as desire. Example:
#media only screen and ( max-width: 640px) {blah}
:)
Related
I have a footer tag on my site which for some reason is out of view, or partly out of view on a nice amount of mobile devices. (I know this through using my browser's developer tools), it can be pulled in to view, but it doesn't stay in view, it gets pulled down again.
The CSS I implemented might be causing this but I need it in order to have the footer stay at the bottom of the page in all cases. (as explained in this question)
This is basically the code for my footer:
html {
height: 100%;
}
main {
padding-right: 200px;
padding-left: 200px;
background-color: white;
flex: 1 0;
}
body {
background-color: #80cbc4;
min-height: 100vh;
display: flex;
flex-direction: column;
}
footer {
text-align: center;
background-color: #d9efef;
height: auto;
flex: 0 0;
}
<html>
<body>
<main>
page content
</main>
<footer>
<p style="direction:rtl;">
רשימת המילים באתר באדיבות: <br> לקסיקון מיל"ה (MILA Hebrew Lexicon),<br> Alon Itai and Shuly Wintner. "Language Resources for Hebrew." Language Resources and Evaluation 42(1):75-98,
March 2008. [BibTeX]
</p>
</footer>
</body>
</html>
This problem happens on these devices (as emulated by my browser's developer tools):
Pixel 2/2 XL
Kindle fire HDX (footer can't even be pulled in to view)
iPhone X/6/7/8 Plus
iPad/iPad Mini/iPad Pro
Surface Duo
Blackberry PlayBook
Nexus 6/6P/7/10
Nokia N9
and not other ones (e.g. desktops), which means that the code above probably doesn't show the problem for other users.
Note:
I've been checking all the options in my dev tools, which means I've included in the list above also some uncommon devices.
Also,
Realize that the emulator does not provide the same experience as a person with an actual Pixel 2 XL device would have. They may have the same resolution, but other behaviors may, and probably will, differ. – Heretic Monkey
Which means this might be happening only in my emulator.
This is what the problem looks like:
How can I make my footer come back in to view on all devices?
This should help:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
If not, it's probably just out of view. Style the footer to always be in view, yet still at the very bottom:
footer {
bottom: 0;
}
You need to include the footer in the body tag to make it a part of the flexbox and set the min-height of body to 100vh. 100% will be dependent on the content size where as 100vh will be based on the height of the viewport.
I have created a simple codepen for this illustration. Play around with the number of list items or body tag. This should solve your problem
You have added padding-right and padding-left of 200px in the styling of <main> tag, due to which the content in <main> is overflowing from <body> while the content of <footer> remains inside the <body>. And due to this, you see additional space on the right side of the footer tag for mobile devices.
I have commented padding-right and padding-left from the main tag and now it is responsive. Also, I would suggest using overflow-x: hidden; in if you don't want your website to scroll horizontally.
html {
height: 100%;
}
main {
/* padding-right: 200px;
padding-left: 200px; */
background-color: white;
flex: 1 0;
}
body {
background-color: #80cbc4;
min-height: 100vh;
display: flex;
flex-direction: column;
/* overflow: hidden; */
}
footer {
text-align: center;
background-color: #d9efef;
height: auto;
flex: 0 0;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
page content
</main>
<footer>
<p style="direction:rtl;">
רשימת המילים באתר באדיבות: <br> לקסיקון מיל"ה (MILA Hebrew Lexicon),<br> Alon Itai and Shuly Wintner. "Language Resources for Hebrew." Language Resources and Evaluation 42(1):75-98,
March 2008. [BibTeX]
</p>
</footer>
</body>
</html>
html {
height: 100%;
}
main {
padding-right: 20px;
padding-left: 20px;
background-color: white;
flex: 1 0;
}
body {
background-color: #80cbc4;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.footer {
text-align: center;
background-color: #d9efef;
height: auto;
position: sticky;
bottom: 0;
}
<html>
<body>
<main>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifend ex non felis pellentesque, eget faucibus risus fringilla. Integer laoreet nec ante non gravida. Ut efficitur accumsan mauris eu auctor. Aenean odio lectus, commodo ut urna quis, vehicula lacinia orci. Praesent laoreet nisl vel ante faucibus, sit amet dictum dui mattis. Vivamus tincidunt mollis lorem. Vestibulum sed erat sit amet tellus vestibulum convallis. Nunc volutpat urna ac dolor sollicitudin suscipit. Nunc vel nunc eu leo sollicitudin suscipit vitae nec elit. Vestibulum lacinia convallis sem. Mauris sed auctor felis, sit amet imperdiet purus. Phasellus sed dignissim dui. Mauris scelerisque scelerisque neque, eget bibendum mi venenatis sit amet.
Vestibulum nec sapien urna. Aenean aliquam felis nec leo eleifend pulvinar. Vivamus quam dui, dapibus nec sem sed, faucibus fringilla sapien. Ut nisl diam, consequat at ligula sit amet, convallis posuere sapien. Vestibulum bibendum a velit ut congue. Nam ac porttitor dolor. Fusce sagittis pellentesque odio, eu dignissim nunc posuere eget. Praesent ac sem eget dui lacinia aliquam. Praesent sem lectus, gravida sit amet lorem sit amet, malesuada condimentum nisi. Nam lacinia egestas mauris sed tincidunt. Vestibulum eget ipsum ut turpis rutrum sodales. Etiam hendrerit vestibulum tincidunt. In tempus at massa maximus dictum. Vivamus sollicitudin sit amet lorem in viverra. In quis ante vitae lectus aliquet elementum.
Duis blandit mauris ut ipsum feugiat, id tincidunt est consequat. Maecenas fermentum, mauris nec scelerisque pellentesque, eros ante elementum eros, et rhoncus erat augue nec urna. Vestibulum et lorem ligula. Cras nec laoreet erat. Mauris quis elementum ligula, nec pellentesque ipsum. Cras porttitor lorem odio, ac bibendum lectus dictum et. Sed imperdiet lacus arcu, nec egestas libero elementum in. Nulla aliquam accumsan dui at dignissim. Cras mattis vel quam nec condimentum. Duis at nisl dui. Proin sagittis finibus libero. Mauris posuere erat non ante rutrum varius. Vestibulum id nisl finibus, imperdiet libero sed, ornare felis. Mauris maximus, dui ac rutrum blandit, erat nisi lacinia massa, eget fermentum enim enim in est. Suspendisse vehicula lectus at mauris interdum sollicitudin.
Vestibulum tristique diam orci, sed tincidunt velit molestie aliquam. Nullam lobortis lectus eu dolor pretium feugiat. Vestibulum metus ex, euismod et neque in, molestie vestibulum augue. Nulla a lacus eget orci cursus convallis in ac metus. Vestibulum at lectus nec odio lobortis gravida in ut ipsum. Curabitur diam purus, vulputate eget condimentum vitae, molestie ac diam. Donec scelerisque convallis mi, sit amet semper orci scelerisque in.
Vestibulum vel justo sit amet sapien eleifend faucibus eu in mi. Donec rutrum sed sapien vel gravida. Maecenas at sapien euismod, semper tortor ut, vehicula nisl. Maecenas vel tortor vel leo ultricies pellentesque sit amet ac diam. Ut tempor finibus odio at venenatis. Mauris nec leo ac enim pretium aliquet. Phasellus pharetra convallis sem eu convallis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id nulla ligula. Suspendisse et est ac velit consequat tempus. Suspendisse fringilla cursus arcu sed auctor. Donec eget luctus risus, eu luctus libero. Quisque vel tellus in ipsum commodo ultrices. Donec bibendum arcu a maximus luctus.
</main>
<div class = 'footer'>
<p style="direction:rtl;">
רשימת המילים באתר באדיבות: <br> לקסיקון מיל"ה (MILA Hebrew Lexicon),<br> Alon Itai and Shuly Wintner. "Language Resources for Hebrew." Language Resources and Evaluation 42(1):75-98,
March 2008. [BibTeX]
</p>
</div>
</body>
</html>
The height of the box of your body is actually 100vh + (8px * 2) because most browsers define a margin of 8px on body.
You have to remove this margin margin: 0;
If you want to get the same feeling as before you can add:
padding: 8px; and box-sizing: border-box;.
https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing
Lastly I would advise to use height: 100vh instead of min-height because you want the body itself to take the whole window height. If the height of its content become greater than the body it will be scrollable.
body {
display: flex; /* or display: grid */
flex-direction: column; /* or grid-template-rows: 1fr min-content */
height: 100vh; /* css grids are awesome */
box-sizing: border-box;
padding: 8px;
margin: 0;
background-color: #80cbc4;
}
Edit: After trying it on Edge mobile emulator, I see that there is a scrollbar on x axis which doesn't change the window height, causing it to scroll vertically.
You may want to disable it overflow-x: hidden OR (better solution) make your content width responsive.
you need to include the attribute of position in the CSS like this...
footer {
text-align: center;
background-color: #d9efef;
height: auto;
flex: 0 0;
position: fixed
}
Totally new to HTML/CSS. I've got the top image/logo done, and the header. How do i get that text formatted like in the picture (3 columns)?
I only tried using table with 3 columns. However i think its harder to style it considering its a table. Like max column width/height etc.
Thanks in advance!
Click for the image
perhaps the easiest way to do this is with the css columns attribute:
div{
column-count:3;
column-gap:100px;
}
<div>this is some random text we want to enter into our html page
</div>
but the better way to do this is with flex
#container{
display:flex;
justify-content:space-between;
}
<div id = 'container'>
<div class='cols'>this is some text</div>
<div class='cols'>we want to add</div>
<div class='cols'>to our html page</div>
</div>
if you want to add a header and a footer you can try:
#container{
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
}
#cols{
display:flex;
justify-content:space-between;
width:100%;
}
<div id='container'>
<div id = "header">my Header</div>
<div id='cols'>
<div>some random</div>
<div> we want to add</div>
<div>to out html page</div>
</div>
<div id ='footer'>my Footer</div>
</div>
For the three text sections, you need three child divisions in one parent division.
<div class="parent">
<div class="child">1</div>
<div class="child">2</div>
<div class="child">3</div>
</div>
Style it this way:
.parent{
display: block;
width: 100%;
margin: 0px auto;
text-align: center;
}
.child{
display: inline-block;
width: 30%;
height: auto;
margin: 0px auto;
text-align: left;
padding-left: 10px;
padding-right: 10px;
}
#media only screen and (max-width: 768px) {
.child{
width: 100%;
}
}
The media query is there to make the divisions stack on one another on mobile screens.
Simply input this style
/* Create three equal columns that floats next to each other */
.column {
float: left;
width: 33.33%;
padding: 10px;
}
And put this code below your image code,
<div class="column">
<p>It occurs in a wide range in sub-Saharan Africa</p>
</div>
<div class="column">
<p>The Indian subcontinent to Southeast and East Asia..</p>
</div>
<div class="column">
<p>The leopard is one of the five extant </p>
</div>
I would suggest that you stay semantically correct and not use DIV tags for everything under the sun. The text in question is paragraph text thus deserves to be in a P tag.
This works for the three-column part of your question. It has the advantage of being correct semantic use of HTML tags, and using CSS to produce table-like formatting without needing to commit the sin of actually using a table like we used to do back in the 90s.
Edit: one other note. You will find that the CSS float property has its uses. However, as you use it, you will also find that overuse of it can complicate the heck out of your layout and cause you to starting pulling hair out in the end. The display table type properties are what I prefer after some years of front end work in my not-so-distant past.
<html>
<head>
<style type="text/css">
.row {
display: table-row;
}
.cell{
display: table-cell;
vertical-align: top;
width: 33.33%;
}
</style>
</head>
<body>
<div class="row">
<p class="cell">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac purus blandit neque dapibus volutpat. Donec et dapibus leo. Ut at sodales magna, quis varius lacus. Ut sapien enim, fermentum eu egestas sed, pretium vel dolor. Nullam congue odio ut sem volutpat, ac dictum mi mattis. Quisque in purus sollicitudin nisl dapibus bibendum a a quam. Sed tristique augue nisi, quis interdum odio aliquet in. Aliquam tristique, dolor sed suscipit lobortis, eros enim mattis purus, vitae consectetur ante est nec libero. Aenean semper, ipsum eget venenatis eleifend, erat erat dignissim mi, non lacinia justo lorem at tortor. Aenean et erat suscipit velit porta placerat nec sit amet augue. Nulla non sem non tellus pellentesque ornare. Vivamus volutpat eget lacus eu dignissim. Sed venenatis euismod tempus. </p>
<p class="cell">Integer euismod felis et elit dapibus laoreet. Pellentesque et massa vitae orci pharetra imperdiet. Proin ultricies velit erat, a semper arcu volutpat eu. Morbi feugiat sapien non nisi faucibus elementum. Curabitur sed justo et enim maximus tempus. Donec posuere gravida justo sit amet dignissim. Etiam vestibulum mauris eros, vitae blandit justo pellentesque nec. Ut varius mattis volutpat. </p>
<p class="cell">Nulla vulputate ipsum leo, ut ornare massa malesuada et. Donec metus enim, viverra id diam a, luctus sagittis turpis. Etiam euismod, ex id convallis tristique, odio tellus placerat nunc, in dapibus risus massa non nulla. In placerat lectus tortor, vel gravida leo pharetra eget. Donec mollis facilisis pharetra. Nulla commodo quam tellus, eget hendrerit nisi aliquet id. Duis sagittis enim eu sodales bibendum. Maecenas tincidunt id mauris vitae ultricies. </pclass="inline">
</div>
</body>
</html>
i want to build this page but i have a problem which is that i don't know how to force the image out of the bootstrap container while retaining responsive layout, is there anyway i could do that without a ton of absolute positioning for each single device?
Web Screen Design
IPads and Smaller Screen Designs
Here's a two-column responsive design that roughly mimics your layout.
It uses the column ordering feature of Bootstrap to swap the order of the text and image blocks on smaller screens.
div {
outline: 1px solid red;
}
.img-absolute {
position: absolute;
top: 80px;
right: 80px;
}
.div-black {
position: absolute;
top: 40px;
right: 40px;
background-color: black;
width: 280px;
height: 280px;
}
#media (max-width: 990px) {
.img-absolute {
right: 380px;
}
.div-black {
right: 340px;
}
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet"/>
<div clas="container">
<div class="row">
<div class="col-lg-6 order-1 order-lg-2">
<h4>Lorem Ipsum</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Integer feugiat scelerisque varius morbi enim. Duis ut diam quam nulla porttitor massa id neque aliquam. Non pulvinar neque laoreet suspendisse interdum consectetur. Tempus urna et pharetra pharetra massa massa ultricies mi quis. Urna duis convallis convallis tellus id interdum velit laoreet id. Lacus vel facilisis volutpat est velit egestas. Eros donec ac odio tempor. Sapien et ligula ullamcorper malesuada proin libero nunc consequat interdum. Morbi tempus iaculis urna id volutpat lacus laoreet. Ultricies mi eget mauris pharetra et ultrices. Habitasse platea dictumst vestibulum rhoncus est pellentesque. Mi quis hendrerit dolor magna eget est lorem. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus. Nulla posuere sollicitudin aliquam ultrices sagittis orci. Neque aliquam vestibulum morbi blandit cursus risus at.</p>
</div>
<div class="col-lg-6 col order-2 order-lg-1">
<div class="div-black"></div>
<img class="img-absolute"
src="https://picsum.photos/600/300" />
</div>
</div>
</div>
New to bootstrap and trying to stack the text below the image on mobile devices of 6" aand less. Working well on 7" and more screen devices.
On bigger screens like tablets and desktops the image and the text are on one row appearing as expected.
But on smaller screens I want the the text to stack below the image and both should be centered; was not getting the desired result cos part of the image and text are cut of when stacked. I want the image and the text to be stacked and no part cut off. That is the problem I want solved.
Here is the code:
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-6 col-lg-6 ">
<img class="aligncenter size-full wp-image-99991388" src="http://francmasones.net/wp-content/uploads/2016/10/sm.png" alt="sm" width="398" height="376" /></div>
<div class="col-xs-12 col-sm-6 col-lg-6">
<p style="text-align: left;"><span style="font-size: 17pt; font-weight: 400;"><strong>Etiam porta urna est, id bibendum nisl hendrerit quis. Fusce vel urna ut neque posuere blandit.!</strong></span></p>
<div class="span6">
<p style="text-align: justify;"><span style="font-size: 15pt;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pulvinar, lacus eu sodales tempor, augue tortor finibus nisi, ut vulputate leo metus eget erat. Suspendisse viverra, urna sed sodales bibendum, lorem urna ullamcorper quam, vel bibendum elit mi feugiat risus. Aliquam aliquet, eros nec porttitor bibendum, justo ex facilisis mauris, vel rhoncus purus eros sed nisl. Nulla faucibus posuere varius. Maecenas sed nisi ullamcorper, bibendum ligula id, ornare quam. Donec fermentum pretium lorem et gravida. Nullam placerat augue sed arcu iaculis vehicula. Pellentesque ultrices, justo eget ultrices vestibulum, ligula risus porta nisl, quis imperdiet ante diam sed dui. Morbi ante lacus, pellentesque ut turpis ut, pulvinar pretium nulla.</span></p>
</div>
</div>
</div>
</div>
You insights and kind responses will be appreciated
I don't understand your question clearly. Any How as per my understanding try this code below the row class.
<div class="center-block"> <div>
Try this:
#media (max-width: 768px) {
.col-xs-12 {
text-align: center
}
}
You can write a Media Query for this according to Bootstrap Grid Media Queries breakpoints. Like:
/* For Mobile Devices (equivalent to col-xs-*) */
#media screen and (max-width: 767px) {
.img-holder img {
margin: 0 auto 15px; /* Centers the image */
}
.text-holder .title {
text-align: center; /* Centers the content */
}
.text-holder .description {
text-align: center; /* Centers the content */
}
}
Have a look at the snippet below:
.text-holder .title {
text-align: left;
}
.text-holder .description {
text-align: justify;
}
/* For Mobile Devices (equivalent to col-xs-*) */
#media screen and (max-width: 767px) {
.img-holder img {
margin: 0 auto 15px;
}
.text-holder .title {
text-align: center;
}
.text-holder .description {
text-align: center;
}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-6 col-lg-6 img-holder">
<img class="img-responsive aligncenter size-full wp-image-99991388" src="http://francmasones.net/wp-content/uploads/2016/10/sm.png" alt="sm" width="398" height="376" /></div>
<div class="col-xs-12 col-sm-6 col-lg-6 text-holder">
<p class="title"><span style="font-size: 17pt; font-weight: 400;"><strong>Etiam porta urna est, id bibendum nisl hendrerit quis. Fusce vel urna ut neque posuere blandit.!</strong></span></p>
<div class="span6">
<p class="description"><span style="font-size: 15pt;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam pulvinar, lacus eu sodales tempor, augue tortor finibus nisi, ut vulputate leo metus eget erat. Suspendisse viverra, urna sed sodales bibendum, lorem urna ullamcorper quam, vel bibendum elit mi feugiat risus. Aliquam aliquet, eros nec porttitor bibendum, justo ex facilisis mauris, vel rhoncus purus eros sed nisl. Nulla faucibus posuere varius. Maecenas sed nisi ullamcorper, bibendum ligula id, ornare quam. Donec fermentum pretium lorem et gravida. Nullam placerat augue sed arcu iaculis vehicula. Pellentesque ultrices, justo eget ultrices vestibulum, ligula risus porta nisl, quis imperdiet ante diam sed dui. Morbi ante lacus, pellentesque ut turpis ut, pulvinar pretium nulla.</span></p>
</div>
</div>
</div>
</div>
Also avoid giving inline styles. It's a bad practice.
Hope this helps!
I'm adding padding around some text into two div columns (content, sidebar). Sidebar column moves under the Content column.
I'm still learning (though I think I'd like to think of myself somewhere between a beginner and intermediate).
Right now, I'm using the blueprint framework for the layout. I have the content column at 15 and the side bar column at 8. Whenever I try to add padding on the right side of each DIV, it causes the side bar to move under the content.
The only fix I could find was to set the width of the sidebar column and make it float to the right.
I thought the purpose of Blueprint was so that I didn't have to set anything for the columns, just add the column class to each div that needs it?
Here is a fiddle: jsfiddle
Here is my HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>CogRobot Studios</title>
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/screen.css" />
<!--[if IE]>
<link rel="stylesheet" href="stylesheets/ie.css" type="text/css" media="screen, projection">
<![endif]-->
<link rel="stylesheet" type="text/css" href="stylesheets/cogrobot.css" />
</head>
<body>
<div id="wrap" class="rounded-corners container">
<div id="header" class="rounded-corners column span-24 last">
<img src="images/header.gif" alt="Starbuzz Coffee header image" />
</div>
<div id="content" class="column span-15 colborder last">
<h1>Lorem ipsum dolor sit amet</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam quis risus eu nisi feugiat tincidunt sed vel eros. Maecenas a bibendum tellus. Nunc eu risus at tortor placerat mollis vel et lacus. Ut non massa odio, et commodo sapien. Aliquam erat volutpat. Morbi sed sem at nunc congue venenatis a blandit nisi. Donec eget tortor nisl, vel laoreet nisi. Donec vel posuere ligula. Nullam mi risus, porta lacinia ullamcorper ut, mollis eget arcu. Nam justo dui, dignissim eu dapibus at, placerat vulputate ante. Suspendisse justo tortor, gravida quis scelerisque in, fringilla non eros.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam quis risus eu nisi feugiat tincidunt sed vel eros. Maecenas a bibendum tellus. Nunc eu risus at tortor placerat mollis vel et lacus. Ut non massa odio, et commodo sapien. Aliquam erat volutpat. Morbi sed sem at nunc congue venenatis a blandit nisi. Donec eget tortor nisl, vel laoreet nisi. Donec vel posuere ligula. Nullam mi risus, porta lacinia ullamcorper ut, mollis eget arcu. Nam justo dui, dignissim eu dapibus at, placerat vulputate ante. Suspendisse justo tortor, gravida quis scelerisque in, fringilla non eros.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam quis risus eu nisi feugiat tincidunt sed vel eros. Maecenas a bibendum tellus. Nunc eu risus at tortor placerat mollis vel et lacus. Ut non massa odio, et commodo sapien. Aliquam erat volutpat. Morbi sed sem at nunc congue venenatis a blandit nisi. Donec eget tortor nisl, vel laoreet nisi. Donec vel posuere ligula. Nullam mi risus, porta lacinia ullamcorper ut, mollis eget arcu. Nam justo dui, dignissim eu dapibus at, placerat vulputate ante. Suspendisse justo tortor, gravida quis scelerisque in, fringilla non eros.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam quis risus eu nisi feugiat tincidunt sed vel eros. Maecenas a bibendum tellus. Nunc eu risus at tortor placerat mollis vel et lacus. Ut non massa odio, et commodo sapien. Aliquam erat volutpat. Morbi sed sem at nunc congue venenatis a blandit nisi. Donec eget tortor nisl, vel laoreet nisi. Donec vel posuere ligula. Nullam mi risus, porta lacinia ullamcorper ut, mollis eget arcu. Nam justo dui, dignissim eu dapibus at, placerat vulputate ante. Suspendisse justo tortor, gravida quis scelerisque in, fringilla non eros.
</p>
</div>
<div id="sidebar" class="column span-8 last">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam quis risus eu nisi feugiat tincidunt sed vel eros. Maecenas a bibendum tellus. Nunc eu risus at tortor placerat mollis vel et lacus. Ut non massa odio, et commodo sapien. Aliquam erat volutpat. Morbi sed sem at nunc congue venenatis a blandit nisi.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam quis risus eu nisi feugiat tincidunt sed vel eros. Maecenas a bibendum tellus. Nunc eu risus at tortor placerat mollis vel et lacus. Ut non massa odio, et commodo sapien. Aliquam erat volutpat. Morbi sed sem at nunc congue venenatis a blandit nisi.
</p>
</div>
<div class="rounded-cornersbottom" id="footer">
© 2005, Lorem ipsum dolor sit amet.
<br />
All trademarks and registered trademarks appearing on
this site are the property of their respective owners.
</div>
</div>
</body>
</html>
Here is my CSS:
#wrap{
position: relative;
top: 100px;
}
body {
/* background-color: #b5a789;*/
font-family: Georgia, "Times New Roman", Times, serif;
font-size: small;
margin: 0px;
}
p, ul, li, h1, h2, h3, h4 {
margin: 0;
}
h3 {
margin: 0 0 20px 0;
padding: 0 0 5px 0;
font-weight: bold;
border-bottom: 1px solid #ccc;
}
#header {
background-color: #838383;
width: 950px;
height: 150px;
}
#content{
background: #c8c8c8;
font-size: 105%;
padding: 20px 20px 20px 20px;
margin: 0;
width: 590px;
}
#sidebar {
float: right;
background: #c8c8c8;
font-size: 105%;
padding: 20px 20px 20px 20px;
margin: 0;
width: 260px;
}
#footer {
background-color: #838383;
color: #c8c8c8;
text-align: center;
font-size: 90%;
clear: left;
}
h1 {
font-size: 120%;
color: #954b4b;
}
h2 {
font-size: 110%;
}
.slogan {
color: #954b4b;
}
.beanheading {
text-align: center;
line-height: 1.8em;
}
a:link {
color: #b76666;
text-decoration: none;
border-bottom: thin dotted #b76666;
}
a:visited {
color: #675c47;
text-decoration: none;
border-bottom: thin dotted #675c47;
}
.rounded-corners {
-moz-border-radius-topleft: 20px;
-moz-border-radius-topright: 20px;
-webkit-border-top-left-radius: 20px;
-webkit-border-top-right-radius: 20px;
-khtml-border-radius: 20px;
}
.rounded-cornersbottom {
-moz-border-radius-bottomleft: 20px;
-moz-border-radius-bottomright: 20px;
-webkit-border-bottom-left-radius: 20px;
-webkit-border-bottom-right-radius: 20px;
-khtml-border-radius: 20px;
}
You could try setting the z-index of the element you want to be on
top. z-index goes from -100 to +100 so you've got a lot of space to
fit elements.
I have no idea about Blueprint.
However, I did the following and it seems to work like how I think you want it
make both the sidebar and the content float:left
take the sidebar out of the content div and place it on its own
remove an extra closing </div>
change the widths of the sidebar and content, down 10px for each (you may need to fiddle with this more.)
use clear:both on the footer
Example: http://jsfiddle.net/5q8Xm/3/embedded/result/
I think I figured out how to fix the problem, or rather, I figured out why it was messing up the way it was.
Since I'm a bit rusty in HTML and CSS, I forgot that padding increases the size of the element. So, because I had blueprint set up to give the the entire layout 24 columns, I thought it would be a good idea to give the content div 15 columns, and the sidebar div 8. Thus, giving 1 column space between the content div and the side bar div.
So when I added padding around the text, it made the divs bigger (at least to my understanding.
So I fixed this by decreasing the sidebar from 8 columns to 7 columns. Giving the padding enough room to not jump down under the content div.
I hope this is a good fix, if there is a more efficient/correct way of doing this, I'd love to hear.