I am unable to move the caption text to the center of the background image and text in the new div is not only moving but formatted.
The text on the image is not at all moving and not only the it's not formatting according the code given in the css. The text in the next div is also not moving and getting formatted.
html
<div class="container1">
<div class="banner">
<div class="banner-text">
<h1> Our shop can be found at </br>
Park Avenue,Street No.1, SF, California </h1>
</div>
</div>
<div class="container2">
<div class="menu">
<h1> Menu </h1>
<p> Donec dapibus rhoncus blandit. Nam eu scelerisque augue. Suspendisse hendrerit rutrum maximus. Fusce elementum rhoncus felis sed elementum. Aenean ultricies, nulla vel scelerisque commodo,
felis eros hendrerit lectus, a porttitor metus massa in nibh. Vivamus egestas placerat quam nec laoreet. Nulla id semper turpis. Integer et imperdiet lacus. Nam ac condimentum neque. Suspendisse luctus porttitor purus,
ac fermentum quam scelerisque eu. Proin eget pulvinar lectus. Duis maximus massa vitae tellus efficitur, et pharetra ex aliquam. Quisque fringilla diam sodales pellentesque condimentum </p>
</div>
css code
.container1 {
width:100%;
margin:0 auto;
margin-top:500px;
}
.banner {
position:relative;
background-image:url('c:/Users/saisa/OneDrive/Desktop/HTML TUTORIAL/social/california.jpg');
background-size:cover;
background-repeat:no-repeat;
background-position:center center;
padding-top:25%;
width:100%;
z-index:-1;
}
.banner-text h1[
position:absolute;
font-family:Javanese Text, Arial, sans-serif;
font-weight:bold;
font-size:100%;
color:#fff;
margin-left:150px;
text-align:center;
transform:translate(-50% -50%);
}
.container2 {
width:100%;
}
.menu,
.images {
width:auto;
float:none;
}
.menu {
width:50%;
float:left;
}
.menu h1 {
font-family:Javanese Text, Arial, sans-serif;
font-weight:bold;
font-size:100%;
margin-left:200px;
}
sai sankar you have to careful when you're writing css. Because if a single character is missed, the code will not work.
In .banner-text h1[ this line
change [ to {
I think it would be better if you attached the link to the demo(e.x. https://jsfiddle.net).
As I can see at the first glance, you have a typo:
.banner-text h1 [ // should be {
position:absolute;
font-family:Javanese Text, Arial, sans-serif;
font-weight:bold;
font-size:100%;
color:red;
margin-left:150px;
text-align:center;
transform:translate(-50% -50%);
}
Related
I have a simple webpage for my terms and conditions section that uses CSS.
However, I cannot make the blueBox wider or longer.
I tried to adjust the height and width using CSS but width and length are not changing. Can you help me out?
Here is the index page.
<div id="mainContentArea">
<div id="contentBox">
<div id="title">BlueBliss Inc.</div>
<div id="linkGroup">
<div class="link">Home</div>
<div class="link">About</div>
<div class="link">Portfolio</div>
<div class="link">Contact</div>
</div>
<div id="blueBox">
<div id="header"></div>
<div class="contentTitle">Welcome to BlueBliss Inc.</div>
<div class="pageContent">
<p>This template was created for those needing a really simple site, without much content.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer mi. Vivamus sit amet neque vitae sapien bibendum sodales. Curabitur elementum. Duis imperdiet. Donec eleifend porttitor sapien. Praesent leo. Quisque auctor velit sed tellus. Suspendisse potenti. Aenean laoreet imperdiet nunc. Donec commodo suscipit dolor. Aenean nibh. Sed id odio. Aliquam lobortis risus ut felis. Sed vehicula pellentesque quam.</p>
<p>Vestibulum augue quam, interdum id, congue semper, convallis non, velit. Quisque augue tortor, tristique ac, scelerisque eget, aliquam id, sem. Aenean lorem. Fusce velit nibh, dapibus quis, laoreet nec, porta a, dui. Nullam ac urna. Proin eget elit. Nunc scelerisque venenatis urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce congue, turpis ut commodo mattis, pede erat fringilla tellus, pulvinar suscipit odio lorem sed pede.</p>
</div>
<div id="footer">web development by bryant smith</div>
</div>
</div>
</div>
CSS
html{
overflow: hidden;
height: 99%;
}
body{
height: 99%;
}
#mainContentArea{
margin: 0 auto 0 auto;
display: table;
height: 100%;
position: relative;
overflow: hidden;
width: 600px;
}
.link,.linkActive{
width:75px;
margin-right:10px;
float: left;
margin-top:24px;
text-align:center;
font-family:Georgia, "Times New Roman", Times, serif;
background-image:url(tab.gif);
position:relative; bottom:0px;
}
#linkGroup{
margin-right:10px;
height:40px;
width:600px;
}
#title{
width:230px;
height:40px;
margin-right:20px;
margin-top:15px;
text-align:center;
float:left;
}
.contentTitle{
margin-left:15px;
margin-right:12px;
margin-bottom:12px;
width:573px;
}
.pageContent{
font-family: Arial, Helvetica, sans-serif;
margin-left:20px;
margin-right:20px;
width:560px;
height:auto;
}
#blueBox{
position: absolute;
vertical-align: middle;
background-color:#E7EDF8;
width:600px;
clear:both;
height:auto;
}
#header{
width:600px;
height:20px;
background-color:#FFFFFF;
background-image:url(header.gif);
background-repeat:no-repeat;
}
#footer{
width:600px;
height:20px;
background-color:#FFFFFF;
background-image:url(footer.gif);
background-repeat:no-repeat;
text-align:center;
padding-right:10px;
}
#contentBox{
margin-top:25px;
}
Also, its limiting me to stay on its size. its not giving me the option to scroll down. please help me. thanks
I see you have this <div id="mainContentArea"> which has
#mainContentArea {
margin: 0 auto 0 auto; display: table;
height: 100%;
position: relative;
overflow: hidden;
width: 661px;
}
the problem is that your #blueBox is inside the #mainContentArea division, which has the property overflow set to hidden. So no matter how much you add to the #blueBox it will be hidden by #mainContentArea
Solution : remove the overflow:hidden line, you dont need it.
I have edited your css so that it can be responsive, it is great to work with reponsive divs. try
#mainContentArea{
width:100%;
}
.link,.linkActive
{
width:75px;
margin-right:10px;
float: left;
margin-top:24px;
text-align:center;
font-family:Georgia, "Times New Roman", Times, serif;
background-image:url(tab.gif);
position:relative; bottom:0px;
}
.link:hover
{
background-image:url(tab2.gif);
}
a
{
text-decoration:none;
}
.link a{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:bold;
}
#linkGroup
{
margin-right:10px;
height:40px;
width:100%;
}
#title
{
width:200px;;
height:40px;
margin-right:10px;
margin-top:15px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:20px;
font-weight:bold;
text-align:left;
float:left;
}
.contentTitle
{
font-family:Verdana, Arial, Helvetica, sans-serif;
color:#213E74;
font-size:19px;
margin-left:15px;
margin-right:12px;
margin-bottom:12px;
width:100%;
text-align:center;
}
.pageContent
{
font-family: Arial, Helvetica, sans-serif;
color:#000000;
font-size:12px;
margin-left:20px;
margin-right:20px;
width:90%;
height:auto;
}
#blueBox
{
position: relative;
vertical-align: middle;
background-color:#E7EDF8;
width:100%;
clear:both;
height:auto;
}
#header
{
width:100%;
height:20px;
background-color:#FFFFFF;
background-image:url(header.gif);
background-repeat:no-repeat;
}
#footer
{
width:100%;
height:20px;
background-color:#FFFFFF;
background-image:url(footer.gif);
background-repeat:no-repeat;
text-align:center;
padding-right:10px;
color:#BDCDEC;
}
#footer a
{
font-size:9px;
color:#BDCDEC;
}
#contentBox
{
margin-top:25px;
}
html, body {
text-align: center;
width:90%;
margin:0 auto;
}
p {text-align: left;}
<head>
<title>Blue Bliss by Bryant Smith</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="bluebliss.css" />
</head>
<body>
<div id="mainContentArea">
<div id="contentBox">
<div id="title">BlueBliss Inc.</div>
<div id="linkGroup">
<div class="link">Home</div>
<div class="link">About</div>
<div class="link">Portfolio</div>
<div class="link">Contact</div>
</div>
<div id="blueBox">
<div id="header"></div>
<div class="contentTitle">Welcome to BlueBliss Inc.</div>
<div class="pageContent">
<p>This template was created for those needing a really simple site, without much content.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer mi. Vivamus sit amet neque vitae sapien bibendum sodales. Curabitur elementum. Duis imperdiet. Donec eleifend porttitor sapien. Praesent leo. Quisque auctor velit sed tellus. Suspendisse potenti. Aenean laoreet imperdiet nunc. Donec commodo suscipit dolor. Aenean nibh. Sed id odio. Aliquam lobortis risus ut felis. Sed vehicula pellentesque quam.</p>
<p>Vestibulum augue quam, interdum id, congue semper, convallis non, velit. Quisque augue tortor, tristique ac, scelerisque eget, aliquam id, sem. Aenean lorem. Fusce velit nibh, dapibus quis, laoreet nec, porta a, dui. Nullam ac urna. Proin eget elit. Nunc scelerisque venenatis urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce congue, turpis ut commodo mattis, pede erat fringilla tellus, pulvinar suscipit odio lorem sed pede.</p>
</div>
<div id="footer">web development by bryant smith</div>
</div>
</div>
</div>
</body>
</html>
Here you put#mainContentArea width: 600px; you change the width then you will get your specification. because #blueBox is under the #mainContentArea. Then you can adjust the #blueBox height and width.
1) First of all remove the "position: absolute;" from the #blueBox
add "height: 100%" to the following selectors a) #blueBox b) #contentBox.
Find sample Code bellow!!
.pageContent {
font-family: Arial, Helvetica, sans-serif;
color:#000000;
font-size:12px;
margin-left:20px;
margin-right:20px;
width:560px;
height:100%;
}
#bluebox {
position: relative;
vertical-align: middle;
background-color:#E7EDF8;
width:600px;
clear:both;
height:100%;
overflow-y: scroll; /*Allow you to scroll inside the blue content*/
}
The problem is that you have restricted the width of your inner div just keep the width of inner divs to 100% and it will expand. hope it will work
You have defined maximum available width at parent element:
#mainContentArea{
width: 600px;
}
So you have not the option to go further from this 600px in width. If you want to set the width of blueBox to a value more than 600px, you should increase it on #mainContentArea element.
Also it would be far more better to hesitate from defining width property for every single element. So, please remove width declaration from these elements:
#linkGroup
#blueBox
#header
.contentTitle
.pageContent
At the end, you dont need to declare position: absolute for #blueBox, so remove it. Likewise, this part of your CSS
html{
overflow: hidden;
height: 99%;
}
body{
height: 99%;
}
is more likely to be removed, if there is no special need for it to remain, as it could cause problems with your simple structure.
#mainContentArea{
margin: 0 auto 0 auto;
display: table;
height: 100%;
position: relative;
width: 600px;
}
.link,.linkActive{
width:75px;
margin-right:10px;
float: left;
margin-top:24px;
text-align:center;
font-family:Georgia, "Times New Roman", Times, serif;
background-image:url(tab.gif);
position:relative; bottom:0px;
}
.link:hover{
background-image:url(tab2.gif);
}
a{
text-decoration:none;
}
.link a{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:bold;
}
#linkGroup{
margin-right:10px;
height:40px;
}
#title
{
width:230px;
height:40px;
margin-right:20px;
margin-top:15px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:20px;
font-weight:bold;
text-align:center;
float:left;
}
.contentTitle
{
font-family:Verdana, Arial, Helvetica, sans-serif;
color:#213E74;
font-size:19px;
margin-left:15px;
margin-right:12px;
margin-bottom:12px;
}
.pageContent
{
font-family: Arial, Helvetica, sans-serif;
color:#000000;
font-size:12px;
margin-left:20px;
margin-right:20px;
height:auto;
}
#blueBox{
vertical-align: middle;
background-color:#E7EDF8;
}
#header{
height:20px;
background-color:#FFFFFF;
background-image:url(header.gif);
background-repeat:no-repeat;
}
#footer{
height:20px;
background-color:#FFFFFF;
background-image:url(footer.gif);
background-repeat:no-repeat;
text-align:center;
padding-right:10px;
color:#BDCDEC;
}
#footer a{
font-size:9px;
color:#BDCDEC;
}
#contentBox
{
margin-top:25px;
}
<div id="mainContentArea">
<div id="contentBox">
<div id="title">BlueBliss Inc.</div>
<div id="linkGroup">
<div class="link">Home</div>
<div class="link">About</div>
<div class="link">Portfolio</div>
<div class="link">Contact</div>
</div>
<div id="blueBox">
<div id="header"></div>
<div class="contentTitle">Welcome to BlueBliss Inc.</div>
<div class="pageContent">
<p>This template was created for those needing a really simple site, without much content.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer mi. Vivamus sit amet neque vitae sapien bibendum sodales. Curabitur elementum. Duis imperdiet. Donec eleifend porttitor sapien. Praesent leo. Quisque auctor velit sed tellus. Suspendisse potenti. Aenean laoreet imperdiet nunc. Donec commodo suscipit dolor. Aenean nibh. Sed id odio. Aliquam lobortis risus ut felis. Sed vehicula pellentesque quam.</p>
<p>Vestibulum augue quam, interdum id, congue semper, convallis non, velit. Quisque augue tortor, tristique ac, scelerisque eget, aliquam id, sem. Aenean lorem. Fusce velit nibh, dapibus quis, laoreet nec, porta a, dui. Nullam ac urna. Proin eget elit. Nunc scelerisque venenatis urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce congue, turpis ut commodo mattis, pede erat fringilla tellus, pulvinar suscipit odio lorem sed pede.</p>
</div>
<div id="footer">web development by bryant smith</div>
</div>
</div>
</div>
I have an arrow image that needs to immediately follow the period of the last sentence in each paragraph. This image is surrounded by an href that needs to link to another page. I cannot figure out how to get this arrow to automatically be positioned next to period of sentence (vs left or right aligned all the way to the edge.) Using background image doesn't really work for me because of the href around image. I know there are ways to link a div, but I'd prefer not to handle it that way if possible.
Here is live code: http://codepen.io/trevoray/pen/LVxYrv
HTML:
<div class="column-4-layout">
<div class="left-column">
<div class="column-container"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/189477/financialPolicy-spl.jpg" />
<h2>Vision and Policies</h2>
<P>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In scelerisque ac nunc eu placerat. Sed vulputate iaculis est vitae gravida. Praesent accumsan leo dapibus aliquam interdum. Vestibulum quis nisl volutpat, tempus metus id, scelerisque erat. Suspendisse sed vestibulum magna. Maecenas dignissim, neque ac accumsan molestie, eros felis sagittis sem, sed tempus nunc turpis sed ex. Praesent elit diam, bibendum sed aliquam vel, sollicitudin at turpis. Phasellus sagittis maximus vehicula. Donec vulputate fermentum ligula nec efficitur. Ut magna libero, pulvinar porttitor rutrum et, bibendum vitae libero. Phasellus ac elementum diam. Praesent scelerisque dui id nunc congue semper. <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/189477/more-arrow.gif" width="15" />
</P>
</div>
<div class="column-container"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/189477/financialPolicy-spl.jpg" />
<h2>Best Practices</h2>
<P>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In scelerisque ac nunc eu placerat. Sed vulputate iaculis est vitae gravida. Praesent accumsan leo dapibus aliquam interdum. Vestibulum quis nisl volutpat, tempus metus id, scelerisque erat. Suspendisse sed vestibulum magna. <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/189477/more-arrow.gif" width="15" />
</P>
</div>
</div>
</div>
</div>
CSS:
.column-4-layout {
color:#565657;
margin-bottom:100px;
padding-left:25px;
padding-right:25px;
}
.column-4-layout .column-container {
width:475px;
margin-top: 50px;
min-height:240px;
}
.tall-column-4 .column-container {
margin-top:40px;
min-height:0;
!important;
}
.column-4-layout .column-container img {
width:227px;
padding-right:15px;
padding-bottom:50px;
float:left;
}
.column-4-layout .column-container p img {
width:auto;
float:right;
padding-top:5px;
margin-right:10px;
display:inline-block;
}
.column-4-layout .left-column {
float:left;
}
.column-4-layout .left-column .column-container:first-child {
margin-top:0px;
}
.column-4-layout .right-column {
float:right;
}
.column-4-layout .right-column .column-container:first-child {
margin-top:0px;
}
Give the anchor display: inline-block.
a{
display: inline-block;
vertical-align: middle;
}
and remove unnecessary padding from the img tag which is inside anchor tag of p tag.
The exact css to use is:
.column-4-layout .column-container p a img {
padding: 0;
}
.column-4-layout .column-container p a{
display: inline-block;
vertical-align: middle;
}
Working Fiddle
find .column-4-layout .column-container p img and do following changes into your css file
.column-4-layout .column-container p img {
display: inline-block;
float: none;
margin-right: 10px;
padding-bottom: 0;
padding-top: 5px;
width: auto;
}
updated your codepen :http://codepen.io/anon/pen/wagvRg
This is now the complete html/CSS because someone aked for it.
This is an updated version but it still does not work! I run this on a localhost (usbwebserver).
I am trying to use a background-image for a div but it will not show the image.The image is in the Images file.
html:
<!DOCTYPE html>
<html>
<head>
<title>Computing</title>
<link rel="stylesheet" type="text/css" href="css/CSS.css">
<link rel="shortcut icon" href="Images/laptop.ico" />
</head>
<header class="Header">
<div class="logo" onClick="location.href='Home.html'"> </div>
<h1>Computing</h1>
</header>
<body>
<div class="opvulling1"></div>
<div class="buttonA">Home</div>
<div class="button" onClick="location.href='Laptops.php'">Laptops</div>
<div class="button" onClick="location.href='Cameras.php'">Camera's</div>
<div class="button" onClick="location.href='gsms.php'">GSM's</div>
<div class="button" onClick="location.href='Contact.html'">Contact</div>
<div class="button" onClick="location.href='Winkelwagen.php'">Winkelwagen</div>
<div class="opvulling2"></div>
<div class="Central">
<section>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lacus augue, aliquam ut gravida eget, adipiscing in elit. Suspendisse potenti. Integer laoreet, risus nec fermentum imperdiet, leo magna interdum eros, eu aliquam turpis risus eget nulla. Vivamus ultrices urna vitae nisl vestibulum cursus. Suspendisse sed gravida libero. Fusce blandit dui id porttitor sodales. Morbi vitae sapien quis nulla gravida dignissim. Donec pharetra ipsum tellus, sed laoreet dui viverra in. Nullam blandit diam ac quam consectetur consectetur. Nulla facilisi. Nam ut quam diam. Nunc nec nisl ut tortor luctus commodo. Fusce nec velit neque. Vivamus ac dui tempor, malesuada lacus sed, sollicitudin odio. Nullam ac adipiscing velit, sed dapibus mauris. Sed et egestas dolor.</section>
<section>Phasellus non interdum nisl. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Morbi sed convallis nisi. In in tellus eleifend, tincidunt metus et, auctor mauris. Nullam risus libero, condimentum in adipiscing elementum, tincidunt ut elit. Sed eu diam sed erat aliquam convallis in a mauris. Cras at enim condimentum dolor consequat consequat. Nulla mattis leo in justo molestie, nec tincidunt nulla consequat. Duis accumsan congue lacus sit amet vehicula. Duis vitae pretium urna. Donec sodales, risus id auctor tempor, nisi nisi vehicula dui, in aliquam ante arcu sit amet dui. Curabitur fringilla cursus erat, id lobortis neque aliquet a. Etiam et pharetra diam.</section>
</div>
css:
body{
background-color:#CAEAED;
}
.logo{
background-image:url('Images/Computing.jpg');
height:100px;
width:200px;
}
.Central{
background-color: #FFFFFF;
width: 50%;
margin-top: 50px;
margin-left:20%;
height: auto;
padding: 1%;
font-family:Arial;
font-size: 16px;
}
.Header{
background-color: #CAEAED;
margin-top:-10px;
margin-left:-10px;
width: 101%;
position:relative;
height: 5%;
padding-top:1px;
padding-right: 1%;
text-align:center;
}
h1{
font-size:30px;
font-family:Arial;
text-align: center;
}
section{
padding: 1%;
}
.button{
background-color:#009999;
font-family:Arial;
font-size: 16px;
position:relative;
float:left;
margin-top: 2px;
margin-right:2px;
height:20px;
padding:5px;
}
.buttonA{
font-family:Arial;
font-size: 16px;
background-color:#015965;
transition: width 2s;
margin-top: 2px;
position:relative;
float:left;
margin-right:2px;
height:20px;
padding:5px;
}
.opvulling1{
background-color:#009999;
float:left;
margin-left:-10px;
margin-top: 2px;
margin-right:2px;
height:20px;
padding:5px;
width:20%;
}
.opvulling2{
background-color:#009999;
float:left;
margin-top: 2px;
margin-right:-2000px;
height:20px;
padding:5px;
width:1200px;
}
.button:hover{
cursor:pointer;
background-color:#1F6B75;
font-family:Arial;
font-size: 16px;
}
img{
height: 250px;
width: 300px;
}
h3{
font-family:Arial;
}
form{
float: left;
margin-left: 20px
}
td{
width:40%;
text-align:center;
}
.Prijs{
float:left;
}
.article{
position:relative;
float:left;
margin-right:20px;
background-color:white;
}
h2{
font-family:Arial;
}
How can I make the image work? I already searched it on the internet but i can't find it anywhere. Someone please help.
change \ with /
.logo{
background-image:url('Images/Computing.jpg');
}
If you don't see the image try to put the dimension of the image for example if is 200*300 try this:
.logo{
width:200px;
height:300px;
background-image:url('Images/Computing.jpg');
}
You're using a backslash instead of a regular slash.
background-image:url('Images\Computing.jpg');}
^
^
background-image:url('Images/Computing.jpg');}
This is supposed to work if the image is indeed in the specified location.
If you have your site on Linux, you should be aware that on the server site, file names are case sensitive (Computing.jpg not equal computing.jpg). Pay attention the file name is same as the css reference.
Good luck!
Use:
background-image:url('../Images/Computing.jpg');
Your CSS is called in a relative way this requires you to specify your path relative to your CSS file.
you should use background-image style as
.logo {
background-image:url('Images/computing.jpg');}
I agree with everyone above about the slash, and that you need a width and height for the BG image but i see something else that might be causing the issue. Assuming that you are doing this on a web server and not locally. If this is a Linux environment then everything needs to be case sensitive. I have found that it is bad practice to use Images/ i would change to images/
Write some text inside your logo div just to ensure that is not problem with the with and height of the div.
I have been able to sucessfully wrap text in a div with an image to the left but I can't wrap the text in a div with the image floated to the right. I have tried floating p left. I have also tried making changing the display mode of the div with right floated image to inline and inline block. I also tried using text-align left.
Here is the code for the div were the text wraps ok.
#text_area_top
{
margin-top:5%; margin-left: 2%;
height: 150px; width:700px; position:relative;
font-family:Arial, Helvetica, sans-serif; font-size:18px;
}
Here is the code for the div where the text won't wrap.
#text_area_bottom
{
margin-top:5%; margin-left: 2%;
height: 150px; width:700px; position:relative;
font-family:Arial, Helvetica, sans-serif; font-size:18px;
background-color:#00FF00;
text-align:left;
}
#text_area_bottom img { float:right; }
Here is some extra code that would be important to know for solving this problem.
p { display:inline-block; position:absolute; margin:0px; }
If there is any more information you need me to include please let me know and I will post promptly.
Here is the html:
<div class="content">
<div id="text_area_top">
<img src="img.png" id="content_img" />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ornare
urna et ligula lobortis sed aliquam eros eleifend. Aliquam gravida tellus mollis
massa rhoncus egestas.
Aliquam molestie arcu vitae est accumsan rutrum. Cras vitae tellus justo. Quisque pulvinar adipiscing dolor, non consectetur enim vehicula quis.Etiam tortor augue, interdum et congue a, imperdiet sed risus. Cras sagittis vestibulum</p>
</div>
<div id="text_area_bottom">
<img src="img.png" id="content_img2" />
<p>Scelerisque vitae, convallis non nibh. Maecenas euismod lacinia ipsum, non vulputate metus eleifend id. Quisque sagittis posuere massa, sed pretium odio dignissim eu. In sit amet est non lectus semper pellentesque vitae in tellus. Nullam facilisis auctor quam at pretium.
</p>
</div>
</div>
Try that it work on my side.
p { width:500px; display:inline-block; position:relative; margin:0px; }
just add a width for your p tag.
I have a css layout which is centered, with 100% height. Everything looks good except that I need borders on the left and right side, with background images, that also must extend to 100% height of the page.
I've tried lots of different options but can't seem to get this worked out.
Please take a look at my code and let me know what I can do. Keep in mind everything but the right and left columns is positioned as I need it.
The left and right columns are leftbdr and rightbdr.
Thanks for any assistance.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Tmp Site Mockup</title>
<!-- <link rel="stylesheet" type="text/css" href="assets/css/core2.css" /> -->
<style type="text/css">
html,body {
margin:0;
padding:0;
height:100%; /* needed for container min-height */
background:#E7E7E7 url(assets/img/bg.gif) repeat-x top;
font-family:arial,sans-serif;
font-size:small;
color:#666;
}
h1 {
font:1.5em georgia,serif;
margin:0.5em 0;
}
h2 {
font:1.25em georgia,serif;
margin:0 0 0.5em;
}
h1, h2, a {
color:#9C090C;
}
p {
line-height:1.5;
margin:0 0 1em;
}
#container {
position:relative; /* needed for footer positioning*/
margin:0 auto; /* center, not in IE5 */
width:974px;
background:#F2F8FB;;
height:auto !important; /* all other browsers */
height:100%; /* IE6: treated as min-height*/
min-height:100%; /* all other browsers */
}
#leftbdr{
width:49px;
float:left;
position:relative;
background:url(assets/img/lftSideShadow.jpg) repeat-y right top;
}
#rightbdr{
width:11px;
float:right;
position:relative;
background:url(assets/img/rgtSideShadow.jpg) repeat-y top;
}
#header {
height:22px;
padding-top: 4px;
padding-right: 27px;
border: 1px solid #6B0100;
background-color:#CE0200;
color:#FFFFFF;
text-align: right;
}
#header p {
font-family: Tahoma, arial;
font-size:11px;
margin:0;
}
#subheader {
height:122px;
border-bottom:2px solid #B3B3B3;
background-color: white;
}
#welcome {
height:31px;
border-top:1px solid white;
border-bottom:1px solid white;
background-color: #C20F00;
}
#topnav {
height:62px;
background:#B1B1B1 url(assets/img/topNavBG.jpg) no-repeat left top;
}
#topnav p{
text-align:right;
padding-right:22px;
font-size:10px;
color:#333;
}
#content {
padding:1em 1em 5em; /* bottom padding for footer */
background:#F2F8FB;
}
#content p {
text-align:justify;
padding:0 1em;
}
#footer {
position:absolute;
height:72px;
width:100%;
bottom:0; /* stick to bottom */
background:#9C090C url(assets/img/footerBG.gif) repeat-x;
color:white;
}
#footer p.left {
float: left;
padding-left:15px;
padding-top:7px;
}
#footer p.right {
float: right;
padding-right:15px;
padding-top:7px;
}
</style>
</head>
<body>
<div id="container">
<div id="leftbdr" > </div>
<div id="header">
Home | Website.com | My Site | Logout
</div>
<div id="subheader">
</div>
<div id="welcome">
</div>
<div id="topnav">
<p><input name="radiobutton" type="radio" value="radiobutton" />All <input name="radiobutton" type="radio" value="radiobutton" />Documents <input name="radiobutton" type="radio" value="radiobutton" />People <input name="radiobutton" type="radio" value="radiobutton" />Google</p>
</div>
<div id="content">
<h2>Lorem ipsum dolor</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam pellentesque arcu eget massa laoreet sit amet eleifend sapien accumsan. Sed ut tellus augue. Phasellus non blandit sem. Aliquam consequat ipsum rhoncus augue vehicula suscipit. Nunc laoreet gravida magna nec sodales. Cras quis lorem erat. Suspendisse eu urna in lorem placerat venenatis. Curabitur sed turpis in nulla convallis blandit. Donec ut tortor libero. Donec ante eros, facilisis vitae dictum eu, ornare nec libero. Nulla turpis purus, eleifend ac porta adipiscing, adipiscing non odio.
</p>
<h2>Vestibulum eu purus</h2>
<p>
Vestibulum eu purus ut enim eleifend sodales vel a purus. Aenean at orci dolor. Sed suscipit lorem nec est venenatis rutrum. Maecenas tempor, mi ac molestie suscipit, augue diam ultricies nibh, sit amet faucibus nulla leo vel nunc. Integer magna est, egestas nec placerat vel, pulvinar sed erat. Sed blandit ligula ac sapien venenatis rutrum. Aenean nec velit ut neque pharetra lobortis. Sed vulputate, ante ut euismod semper, nisi ante viverra ipsum, ac malesuada tellus nibh in tellus. Proin non velit ligula, eget egestas sapien. Curabitur ut viverra leo. Suspendisse pellentesque mauris lectus. Aenean sed arcu eleifend tortor cursus dapibus id in turpis. Nullam neque purus, congue id consectetur ut, dignissim id dolor. Praesent vehicula arcu vitae tellus lobortis mollis. Sed nec dapibus orci.
</p>
<h2>Maecenas faucibus sapien</h2>
<p>
Vestibulum at nibh nec elit pulvinar feugiat vel et erat. Maecenas faucibus sapien at enim dictum pharetra ac et augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In porttitor consequat auctor. Phasellus eu nibh nulla. Donec tempor scelerisque sodales. Fusce id neque quam. Cras sollicitudin dictum nisi, eu facilisis velit sodales quis. Aenean tempus congue erat in consequat. Curabitur odio ipsum, luctus sit amet accumsan quis, consequat nec elit. Nunc tristique nunc eget metus placerat vitae consequat erat tempus.
</p>
<p> </p>
</div>
<div id="footer">
<p class="left">
2010 Company Name, Inc. All Rights Reserved.<br />
<span style="color:#CCCCCC;">For internal use only by Company employees. Please do not disturibute.</span>
</p>
<p class="right">
Company Home | My Site | Log Out
</p>
</div>
<div id="rightbdr" > </div>
</div>
</body>
#container is the key. It takes up the full area of your page. You could apply a background/border style to it and/or <body> to achieve what you want.
For example a repeating image slice on <body> that is centered with repeat-y could give the effect of a graphical border without needing leftbdr and rightbdr.