Unwanted white area - css

Have a look at the picture: http://i.stack.imgur.com/jkK3u.jpg
I try to create a site title floating above the header image, but there is an unwanted space that I can not erase. Here is my CSS code:
#header {
clear:both;
overflow:hidden;
z-index:1;
position:relative;
max-width:1130px;
margin:10px auto 0;
}
.site_title {
overflow:hidden;
margin-top:50px;
background-color:#c03;
height:40px;
width:50%;
float:left;
}
.st_hidden .site_title {
}
.site_title h1 {
float:left;
padding:0 0 0 10px;
font-size:28px;
font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;
}
/*site title*/
.site_title h1 a {
color:#fff;
line-height:36px;
}
/* site title */
.site_title h1 .header_logo a {
overflow:hidden;
display:block;
width:100%;
height:36px;
text-indent:-9999px;
}
.site_title h2 {
float:left;
height:20px;
overflow:hidden;
line-height:18px;
padding:10px 0 0 20px;
color:#fff;
font-size:12px;
font-weight:normal;
}
/* site slogan*/
#header_image {
max-width:1130px;
max-height:182px;
margin-bottom:5px;
padding:1px;
border:2px solid #ccc;
margin-top:0px;
}
.st_hidden #header_image {
margin-top:5px;
}
#header_image_border {
overflow:hidden;
width:100%;
height:100%;
}
#header_image_border img {
width:100%;
height:100%;
}
and here is my HTML code:
<div id="header"<?php if($zbench_options['hide_title']!='') echo ' class="st_hidden"'; ?>>
<?php $logo=''; if($zbench_options['logo_url']!='') $logo=' class="header_logo" style="background:url('.$zbench_options['logo_url'].') no-repeat 0 0"'; ?>
<div class="site_title">
<h1 <?php if($logo) echo $logo; ?>><?php bloginfo('name'); ?></h1>
<h2><?php bloginfo('description');?></h2>
<div class="clear"></div>
</div>
<?php if ( get_header_image() != '' ) {
?>
<div id="header_image">
<div id="header_image_border">
<img src="<?php header_image(); ?>" width="1130" height="180" alt="" />
</div>
</div>
<?php } ?>
</div>

The space is caused by this line:
margin-top: 50px
in .site_title tag. You should remove this line. If you want to place the text really on the image and not next to it, add
position: absolute | relative
to the image and set the top attribute - it depends on exactly what you want to get.

Related

Center image in ajustable div

I have a Div with a 10% width and within its content there is an image I want to be able to center vertically/Horizontally and resize to fit in its container.
It resize well when the windows resize but do not know how can i center the image within the container.
<div class="proyecto_holder">
<div class="tipo_proyecto_image">
<img src="http://i57.tinypic.com/vgo9k5.png" border="0" />
</div>
<div class="proyecto_datos_holder">
<div class="proyecto_titulo">This id the title of the project</div>
<div class="proyecto_tipo">Type of Project</div>
</div>
.proyecto_holder {
width:100%;
float:left;
height:75px;
overflow:hidden;
background-color:#F2F2F2;
margin-top:1px;
}
.tipo_proyecto_image {
width:10%;
height:75px;
float:left;
}
.tipo_proyecto_image img {
width:80%;
}
.proyecto_datos_holder {
width:90%;
height:75px;
float:left;
}
.proyecto_titulo {
width:100%;
float:left;
font-family: Titillium Web;
font-size:18px;
font-weight:bold;
line-height:20px;
margin-top:10px;
color:#666666;
}
.proyecto_tipo {
float:left;
font-family: Titillium Web;
font-size:16px;
line-height:20px;
color:#11BB00;
padding: 10px 15px;
}
Here is the demo: https://jsfiddle.net/3t2shesb/
Thanks in advance.
If I understand what you want to do, try using transform and position:relative on the img to give you something like this:
.tipo_proyecto_image img {
width: 80%;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
As shown here:
.proyecto_holder {
width:100%;
float:left;
height:75px;
overflow:hidden;
background-color:#F2F2F2;
margin-top:1px;
}
.tipo_proyecto_image {
width:10%;
height:75px;
float:left;
}
.tipo_proyecto_image img {
width: 80%;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.proyecto_datos_holder {
width:90%;
height:75px;
float:left;
}
.proyecto_titulo {
width:100%;
float:left;
font-family: Titillium Web;
font-size:18px;
font-weight:bold;
line-height:20px;
margin-top:10px;
color:#666666;
}
.proyecto_tipo {
float:left;
font-family: Titillium Web;
font-size:16px;
line-height:20px;
color:#11BB00;
padding: 10px 15px;
}
<div class="proyecto_holder">
<div class="tipo_proyecto_image">
<img src="http://i57.tinypic.com/vgo9k5.png" border="0" />
</div>
<div class="proyecto_datos_holder">
<div class="proyecto_titulo">This id the title of the project</div>
<div class="proyecto_tipo">Type of Project</div>
</div>
The following works ...
HTML:
<div class='Container'>
<img src='test.png'>
</div>
CSS:
div.Container {
position:absolute;
top:25%;left:25%;
width:50%;height:50%;
background:#FF0;
}
div.Container > img {
display:block;
position:absolute;
left:10%; width:auto;
top:35%; height:30%;
}
Here I assign all 100% of the parents height in the img’s css-declaration (2*)35% + 30%, and use that for scaling ... Maybe not what you want, but it works ... try it out :)

problems with spaces when assigning url values in code-behind background-images in asp.net

I'm making some kind of musically website where any of paid customers video uploads will appear on the home page of the website. I uploaded the videos and created a thumbnail from video altogether in one upload button, and try to assign two automatically-created divs to the website based on the number of rows it returns in the database (one is for the banner, another is for the link of the website where both divs are in an position:absolute). Im getting the thumbnail through the user id returned from the database, but an error coming out when inspecting the elements where the spaces returned from the database cannot be read and are considered as closing of a quotation mark. The thumbnails never comes out, but when changing the codes from inspection of elements in chrome, it works. i don't know how to resolve this and was hoping that the fine people in stackoverflow would help me. Here are the codes.
Home Page
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%# Register Src="~/HeaderUnlogged.ascx" TagPrefix="uc1" TagName="HeaderUnlogged" %>
<!DOCTYPE html>
<% default_aspx ds = new default_aspx();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div class="containerAll">
<div class="header">
<uc1:HeaderUnlogged runat="server" ID="HeaderUnlogged" />
</div>
<div class="mainContent">
<div class="firstContent">
<div class="headline"><h2>News</h2></div>
<div class="content">
<div class="contentMusic">
<div class="music">
<div class="innerHeadLine">Musics</div>
<div class="innerContent">
<% displayAudioDiv();%>
</div>
</div>
</div>
<div class="contentVideos">
<div class="videos">
<div class="innerHeadLine">Videos</div>
<div class="innerContent">
<div class="innerItems">
<% displayVideoDiv();%>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="secondContent">
<div class="headline"><h2>Media</h2></div>
<div class="content">
<div class="contentTabs">
<div class="tabs">
<div class="innerHeadLine">Tabs News</div>
<div class="innerContent">
insert butoh here
</div>
</div>
</div>
<div class="contentMusic">
<div class="music">
<div class="innerHeadLine">ini untuk tabs</div>
<div class="innerContent">
insert jahanam here
</div>
</div>
</div>
<div class="contentVideos">
<div class="videos">
<div class="innerHeadLine">ini untuk tabs</div>
<div class="innerContent">
insert bongok here
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
</div>
</div>
</form>
</body>
</html>
Code Behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class _Default : System.Web.UI.Page
{
string cs = ConfigurationManager.ConnectionStrings["testing1"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
}
public void displayVideoDiv()
{
using (SqlConnection con = new SqlConnection(cs))
{
SqlCommand cmd = new SqlCommand("select * from media where fileType = 'Video'", con);
con.Open();
SqlDataReader drVideo = cmd.ExecuteReader();
while (drVideo.Read())
{
Response.Write(
"<div class='listContent'>" +
"<div class='videoBanner'></div>" +
"<div class=listItems style=background-image:url('userData/Videos/"+drVideo["id"].ToString()+"/" + drVideo["imageName"].ToString()+"');>" +
"<a href='#' class='a'>" +
drVideo["fileName"] +
"</a>" +
"</div>" +
"</div>");
}
}
}
public void displayAudioDiv()
{
using (SqlConnection con = new SqlConnection(cs))
{
SqlCommand cdm = new SqlCommand("select * from media where fileType = 'Audio'", con);
con.Open();
SqlDataReader drAudio = cdm.ExecuteReader();
while (drAudio.Read())
{
Response.Write(
"<div class='listContent'>" +
"<div class='audioBanner'></div>" +
"<div class='listItemsAudio'>" +
"<a href='#' class='a'>" +
drAudio["fileName"] +
"</a>" +
"</div>" +
"</div>");
}
}
}
}
Css
#font-face {
font-family: 'Cabin-Bold';
font-weight:bold;
src: url('cabin/Cabin-Bold.otf');
}
#font-face {
font-family: 'Cabin-BoldItalic';
font-weight:bold;
font-style:italic;
src: url('cabin/Cabin-BoldItalic.otf') ;
}
#font-face {
font-family: 'Cabin-Italic';
font-style:italic;
src: url('cabin/Cabin-Italic.otf') ;
}
#font-face {
font-family: 'Cabin-Medium';
font-size:medium;
src: url('cabin/Cabin-Medium.otf') ;
}
#font-face {
font-family: 'Cabin-MediumItalic';
font-size:medium;
font-style:italic;
src: url('cabin/Cabin-MediumItalic.otf') ;
}
#font-face {
font-family: 'Cabin-Regular';
src: url('cabin/Cabin-Regular.otf') ;
}
#font-face {
font-family: 'Myra 4F Caps Bold';
font-weight:bold;
src: url('myra_full_set/Myra 4F Caps Bold.otf') ;
}
#font-face {
font-family: 'Myra 4F Caps Light';
font-weight:lighter;
src: url('myra_full_set/Myra 4F Caps Light.otf') ;
}
#font-face {
font-family: 'Myra 4F Caps Regular';
src: url('myra_full_set/Myra 4F Caps Regular.otf') ;
}
body {
height:100%;
width:100%;
margin: 0 0 0 0;
background-image:url("pics/musicBanner.jpg");
font-family:'Myra 4F Caps Regular';
background-size:cover;
background-attachment:fixed;
overflow-y:scroll;
}
.headerLink{
padding:10px 10px 10px 10px;
font-family:'Cabin-Regular';
width:1004px;
margin:auto auto;
background:#ffffff;
}
.link1, .link2, .link3
{
text-decoration:none;
color:black;
padding:0 10px 0 10px;
}
.link1:visited, .link2:visited, .link3:visited
{
color:black;
}
.link1:hover, .link2:hover, .link3:hover
{
color:rgb(52, 110, 122);
}
.headerLogo
{
margin: auto auto;
width:1024px;
height:100px;
}
.headerLogo .banner
{
width:1024px;
height:100px;
display:inline-block;
}
.headerLogo .banner .bannerLogo
{
width:675px;
height:100px;
float:left;
background-size:cover;
border-right:5px groove;
}
.headerLogo .banner .bannerLogo h1
{
font-family:'Myra 4F Caps Regular';
font-size:2em;
text-align:right;
padding: 0 20px 0 0;
width:340px;
float:right;
}
.headerLogo .headerLoginRegister
{
width:344px;
height:100px;
float:left;
}
.headerSearch
{
width:1022px;
height:70px;
margin:auto auto;
padding-top:9px;
position:relative;
top:0;
font-family:'Cabin-Regular';
display:block;
background-size:cover;
}
.headerSearch span
{
padding: 0 20px 0 20px;
}
.containerAll
{
margin: auto auto;
}
.loginRegister
{
margin: 10px 0 0 25px;
width:340px;
height:50px;
}
.userID span
{
width:100px;
display:inline-block;
}
.passwordUser span
{
width:100px;
display:inline-block;
}
.userID
{
width:340px;
}
.passwordUser
{
width:340px;
}
.textBoxLogin
{
width:180px;
}
.loginButton
{
width:142px;
font-family:Cabin-Regular;
padding:5px;
}
.loginButtons {
margin: 0 0 0 26px;
}
.searchButtons
{
padding:10px;
width:180px;
background:#3C5E43;
}
.dropDown{
width:120px;
padding:5px;
font-family:Cabin-Regular;
font-size:1.1em;
}
.searchTextBox{
width:695px;
color : #747862;
height:20px;
padding:4px 8px;
}
.bottomItem{
margin:6px 0 0 20px;
}
.mainContent{
margin:auto auto;
padding-top:10px;
width:1024px;
font-family:Cabin-Regular;
}
.firstContent {
width:1024px;
border:1px solid;
}
.firstContent .headline{
width:1014px;
padding: 1px 0 1px 10px;
background:#ffffff;
border-bottom:5px groove;
}
.firstContent .content{
width:1024px;
display:inline-block;
}
.firstContent .content .contentMusic{
position:relative;
width:512px;
float:left;
background:#ffffff;
}
.firstContent .content .contentVideos{
position:relative;
width:512px;
float:left;
background:#ffffff;
}
.firstContent .content .contentMusic .music .innerHeadLine{
position:relative;
width:502px;
padding:5px;
background:#000000;
color:#ffffff;
}
.firstContent .content .contentVideos .videos .innerHeadLine{
position:relative;
width:497px;
border-left:5px groove;
padding:5px;
background:#000000;
color:#ffffff;
}
.firstContent .content .contentMusic .music .innerContent{
position:relative;
width:502px;
height:500px;
padding:0 5px 0 5px;
border-right:1px;
background:#ffffff;
border-top:5px groove;
}
.firstContent .content .contentVideos .videos .innerContent{
position:relative;
width:502px;
height:500px;
padding:0 5px 0 5px;
background:#ffffff;
border-top:5px groove;
}
.secondContent {
width:1024px;
margin:25px auto;
border:1px solid;
}
.secondContent .headline{
width:1014px;
padding: 1px 0 1px 10px;
background:#ffffff;
border-bottom:5px groove;
}
.secondContent .content{
width:1024px;
display:inline-block;
}
.secondContent .content .contentTabs {
position:relative;
width:340px;
float:left;
}
.secondContent .content .contentMusic{
position:relative;
width:340px;
float:left;
}
.secondContent .content .contentVideos{
position:relative;
width:340px;
float:left;
}
.secondContent .content .contentTabs .tabs .innerHeadLine{
position:relative;
width:330px;
padding:5px;
border-right:5px groove;
}
.secondContent .content .contentMusic .music .innerHeadLine{
position:relative;
width:330px;
padding:5px;
border-right:5px groove;
}
.secondContent .content .contentVideos .videos .innerHeadLine{
position:relative;
width:330px;
padding:5px;
}
.secondContent .content .contentTabs .tabs .innerContent{
position:relative;
width:330px;
height:500px;
border-top:5px groove;
padding:5px 5px 0 5px;
}
.secondContent .content .contentMusic .music .innerContent{
position:relative;
width:330px;
height:500px;
border-top:5px groove;
padding:5px 5px 0 5px;
}
.secondContent .content .contentVideos .videos .innerContent{
position:relative;
width:330px;
height:500px;
border-top:5px groove;
padding:5px 5px 0 5px;
}
.header{
border:1px solid;
width:1024px;
margin:auto auto;
}
.listItems{
width:492px;
height:25px;
border:none;
padding:50px 0 0 10px;
border-top:1px groove;
border-left:1px groove;
position: absolute;
}
.listItemsAudio{
width:492px;
height:25px;
border:none;
padding:50px 0 0 10px;
border-top:1px groove;
border-left:1px groove;
position: absolute;
background-image: url('pics/audioBanner.jpg');
}
.a{
text-decoration:none;
font-family:Cabin-Regular;
color:orange;
}
.a:hover{
font-family:Cabin-Regular;
color:rgb(52, 110, 122);
}
.listContent{
margin:0 0;
width:512px;
height:72px;
position:relative;
display:block;
padding-top:3px;
}
These are the codes. the problems are in the displayVideoDiv():-
public void displayVideoDiv()
{
using (SqlConnection con = new SqlConnection(cs))
{
SqlCommand cmd = new SqlCommand("select * from media where fileType = 'Video'", con);
con.Open();
SqlDataReader drVideo = cmd.ExecuteReader();
while (drVideo.Read())
{
Response.Write(
"<div class='listContent'>" +
"<div class='videoBanner'></div>" +
"<div class=listItems style=background-image:url('userData/Videos/"+drVideo["id"].ToString()+"/" + drVideo["imageName"].ToString()+"');>" +
"<a href='#' class='a'>" +
drVideo["fileName"] +
"</a>" +
"</div>" +
"</div>");
}
}
}
where it couldnt read the supposedly path which is ('userData/Videos/0/some image file name.jpg'). It couldn't read the spaces between 'some image file name.jpg'.
here is how it looks like in the element inspection in chrome.
<div class="listItems"
style="background-image:url('userData/Videos/0/Richie" allan="" -="" dimarzio="" illuminator="" 7_hd.jpg');="">
<a href="#" class="a">
Richie Allan - DiMarzio Illuminator 7_HD.mp4
</a>
</div>
Please help me. The problems are only in the displayVideoDiv(). Any help would be highly appreciated and loved. Thank you in advance. And sorry for the long post as i don't know how to explain this problem myself.
You can use Uri.EscapeDataString()
Uri.EscapeDataString(drVideo["imageName"].ToString())
This will replace space with %20

Specific display of inline-block with H1 and Image

I'm making my page and while doing it I've encountered a big problem for me because it makes my all effort useless if i can't do it.
In my page Header with menu and everything i can't make 3 images and one H1 to be displayed inline. I wouldn't be posting but I've tried everything and it doesn't work. in a trivial web site it works perfectly but i don't know why in my it doesn't work...
here is my code.
<div id="header">
<img src="img/pl.jpg" width="25" height="15" alt="pl">
<img src="img/no.jpg" width="25" height="15" alt="no">
<img src="img/usgb.jpg" width="25" height="15" alt="en">
<h1 class="title"><?php echo $TITLE; ?></h1>
<div id="nav">
<?php echo $ABOUTME; ?>
<?php echo $GOALS; ?>
<?php echo $ACHIEVEMENTS; ?>
<?php echo $CV; ?>
<?php echo $CREATIVITY; ?>
<?php echo $FREETIME; ?>
<?php echo $CONTACT; ?>
<div class="navEnding"></div>
</div>
And my CSS:
#header {
position:fixed;
margin:0;
padding:0;
top:0%;
left:0%;
width:20%;
height:100%;
z-index:50;
color:#f9f89d;
font-family:"Allura", cursive;
font-size:130%;
background:#f00;
}
.languageFlag { position:relative; display:inline-block; margin:0; padding:0; width:auto; }
.languageFlag img { display:inline-block; width:100%; height:100%; }
.title { position:relative; display:inline-block; margin:0%; padding:0; left:200%; width:200%; height:5%; overflow:hidden; }
#nav {
position:relative;
margin:0;
padding:0;
width:500%;
height:500%;
background:#00f;
}
#nav a:link, #nav a:visited {
display:inline-block;
margin:0.5% 0;
background:#385160;
text-align:left;
text-decoration:none;
border:0;
color:#f9f89d;
}
#nav a:hover, #nav a:active {
text-align:right;
}
.nav1 { width:55%; padding:0 40% 0 5%; }
.nav2 { width:45%; padding:0 50% 0 5%; }
.nav3 { width:35%; padding:0 60% 0 5%; }
.nav4 { width:30%; padding:0 65% 0 5%; }
.nav5 { width:25%; padding:0 70% 0 5%; }
.nav6 { width:20%; padding:0 75% 0 5%; }
.nav7 { width:15%; padding:0 80% 0 5%; }
.navEnding { display:inline-block; margin:0.5% 0; background:#385160; width:90%; min-height:10%; }
Try this. I also removed some unnecessary css.
Fiddle
CSS
#header {
position:fixed;
margin:0;
padding:0;
top:0%;
left:0%;
width:100%;
height:20%;
z-index:50;
color:#f9f89d;
font-family:"Allura", cursive;
font-size:130%;
background:#f00;
}
.languageFlag {
position:relative;
display:inline-block;
margin:0;
padding:0;
width:auto;
}
.languageFlag img {
display:inline-block;
width:100%;
height:100%;
}
.title {
display:inline-block;
}
#header is not long enough for the h1 to fit inside it. try making width:100%
#header {
width: 100%;
}
http://jsfiddle.net/MtcSY/
Edit: hand rolling this advanced css can be very dififcult, I would recommend using a framework like bootstrap

display image a text inline with each other

i have this CSS:
<style type="text/css">
#box {
width:100%;
height:80px;
background-color:#eeeeee;
}
.box-inner {
width:80%;
margin:0 auto 0 auto;
text-align:center;
}
#text, #text a {
font-size:16px;
color:#F36F25;
margin:10px;
}
#text:hover, #text a:hover {
color:#666666;
text-decoration:none;
}
#text img {
vertical-align: middle;
margin-right:20px;
}
</style>
its currently displaying the image and text inline but i have multiple images/text below each other. how can i make all the images align in the same position below each other?
here is a fiddle: http://jsfiddle.net/8dsTu/
http://jsfiddle.net/8dsTu/4/
<div id="text">
<img src="../images/icons/address.png" height="60" />
<div style="display:inline-block;">
Address 1,<br />
Address 2,<br />
County Post Code
</div>
</div>
Edit css:
.box-inner {
width:80%;
margin:0 auto 0 auto;
text-align:left;
margin-left:100px;
}
Your HTML is invalid, id property is meant to be unique and you have a few <div> elements with id="text". To get what you want you'll have to: (jsFiddle)
replace all id="text" with class="text" and add <div class="caption"> to wrap each of the captions:
<div id="box">
<div class="box-inner">
<div class="text">
<img src="../images/icons/telephone.png" height="60" />
<div class="caption">00000 00 00 00</div>
</div>
<div class="text">
<img src="../images/icons/email.png" height="60" />
<div class="caption">sales#domain.co.uk</div>
</div>
<div class="text">
<img src="../images/icons/address.png" height="60" />
<div class="caption">Address 1,<br />Address 2,<br />County Post Code</div>
</div>
</div>
</div>
Adjust the css:
#box {
width:100%;
height:80px;
background-color:#eeeeee;
}
.box-inner {
width:80%;
margin:0 auto 0 auto;
text-align:center;
}
.text, .text a {
font-size:16px;
color:#F36F25;
margin:10px;
}
.text:hover, .text a:hover {
color:#666666;
text-decoration:none;
}
.text img {
vertical-align: middle;
margin-right:20px;
}
.caption{ /* This is the new bit - display:inline-block does the trick. adjust margin-top to your needs */
display:inline-block;
vertical-align:top;
margin-top:15px;
}
#box {
width:100%;
background-color:#eeeeee;
}
.box-inner {
width:80%;
margin:0 auto 0 auto;
text-align:center;
}
.text, .text a {
font-size:16px;
color:#F36F25;
}
.text:hover, .text a:hover {
color:#666666;
text-decoration:none;
}
.text img {
vertical-align: middle;
margin-right:20px;
width: 60px;
background: black;
float: left;
}
.text {
overflow: hidden;
width: 250px;
margin: 10px auto;
}
Something like this? But you must replace your id's with classes.

div content over spilling, inline-block useless

Im a self learner for web designing, so i might missed out some fundamentals coding.
So the problem is the content is overspilling the div from the right in one line.
The code as below
THE HTML
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title></title>
</head>
<body>
<div id="bg">
<div id="mainwrapper">
<div id="header">
<div id="logo"></div>
</div>
<div id="contentwrapper">
<div id="leftwrapper">
<div id="contentspacing">
<div id="content">
<p>
asdfasdfasdfasdvvasdvasdvasdvfasdvsdasdas
dfasdfasdfasdvvasdvasdvasdvfasdvsdasdasdfasdfas
</p>
</div>
</div>
</div>
<div id="rightwrapper">
asdfasdf
</div>
</div>
</div>
</div>
</body>
</html>
THE CSS AS BELOW
/* ---------------------------------------------------------------*/
/* ---------------------> RESET <<<-------------------------*/
/* ---------------------------------------------------------------*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
body {
line-height:1;
}
body {
font-family:Arial,sans-serif;
font-size:100%;
line-height:1.3em;
_font-size:16px;
color:#504e45;
background:#ebe9e1 url(pics/bg.jpg) top left repeat-x;
}
#bg {
float:left;
display:block;
height:600px;
width:100%;
background:url(pics/hotel-bg.jpg) top center no-repeat;
margin:0 0 0 0;
}
#mainwrapper {
float:left;
display:block;
width:1000px;
margin:0 auto;
}
#header {
float:left;
display:block;
}
#logo {
width:274px;
height:44px;
background:url(pics/logo.png) no-repeat;
margin:50 0 0 100;
}
p {
float:left;
display:inline-block;
line-height:1.7em;
margin:1em 0;
-webkit-margin-before:1em;
-webkit-margin-after:1em;
-webkit-margin-start:0px;
-webkit-margin-end:0px;
}
#contentwrapper {
float:left;
display:block;
width:1000px;
}
#leftwrapper {
float:left;
display:block;
width:593px;
}
#contentspacing {
float:left;
display:block;
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
#content {
float:left;
display:block;
height:auto;
width:593px;
border:1px solid #bdc9f4;
background:url(pics/bg2.png) top left repeat-x;
margin:35 120;
}
#rightwrapper {
float:left;
display:block;
}
Add word-wrap: break-word; word-break: break-all; to #content
Demo here http://jsfiddle.net/ZK6yR/
This occurs when you are using rather long words. Try this:
word-wrap: no-break;

Resources