Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-31-2012, 07:03 PM   PM User | #1
jofield
New Coder

 
Join Date: Oct 2011
Location: Essex, England
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
jofield is an unknown quantity at this point
Help for Newbie with alignment of divs across all browers

Hi

I'm used to coding in HTML but I've just created a new website on WordPress (I've attempted to make my own theme!!) and am having a little alignment issue with the CSS across different browsers.

It views perfectly on FireFox on the Mac, but when viewed in IE on Windows the main content box and the sidebar box overlap in the middle. On Firefox for Windows the boxes are miles apart, and on an OS device they majorly overlap. Isn't there something else I can do to make it look at least remotely similar across all browsers?

Web page is http://jamieflynnbase.com/blog/

CSS I currently have is as follows:
Code:
a/*
Theme Name: sandboxkid
Theme URI: http://www.plaintxt.org/themes/sandbox
Description: Child Theme for Sandbox
Author: JoJoField
Author URI: http://www.jojofield.com
Template: sandbox
Version: 0.1
*/
 
@import url("/sandbox/style.css");

html, body {

        background: url(/images/background.jpg) no-repeat center center fixed;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;

height: 100%;
    font-family: "Trebuchet MS", Helvetica, sans-serif;
    font-size: 13px;
    color: #FFCC33; 
    line-height:1.4em; /* 16*1.4=18 */
}

h1, h2, h3 {
	font-weight: normal;
	color: #FFCC33;
}

a:link {
	color: #FFCC33;
}

a:hover {
	text-decoration: none;
	color: #FFFFFF;
}

a:visited {
	text-decoration: none;
	color: #FFFFFF;
}

div#container {
float:left;
margin:0 -490px 0 0;
width:100%;
}

div#content {
float: left;
width: 490px;
min-height: 100%;
background-color:rgba(0,45,80,0.8);
margin: 0 0 0 170px;
border: 30px solid rgb(0,45,80);
    border: 30px solid rgba(0,45,80,0.8);
    -webkit-background-clip: padding-box; /* for Safari */
    background-clip: padding-box; /* for IE9+, Firefox 4+, Opera, Chrome */
border-radius:25px;
}
* html #container {
height: 100%;
}

div#containernosidebar {
float:left;
margin:0 -490px 0 0;
width:100%;
}

div#contentnosidebar {
float: left;
width: 860px;
min-height: 100%;
background-color:rgba(0,45,80,0.8);
margin: 0 0 0 170px;
border: 30px solid rgb(0,45,80);
    border: 30px solid rgba(0,45,80,0.8);
    -webkit-background-clip: padding-box; /* for Safari */
    background-clip: padding-box; /* for IE9+, Firefox 4+, Opera, Chrome */
border-radius:25px;
}
* html #container {
height: 100%;
}

div.sidebar {
float:right;
overflow:hidden;
width:225px;
min-height: 100%;
background-color:rgba(0,45,80,0.8);
margin: 0 175px 0 30px;
text-align: center;
border: 30px solid rgb(0,45,80);
    border: 30px solid rgba(0,45,80,0.8);
    -webkit-background-clip: padding-box; /* for Safari */
    background-clip: padding-box; /* for IE9+, Firefox 4+, Opera, Chrome */
border-radius:25px;
}
* html #container {
height: 100%;
}


div#footer {
clear:both;
width:100%;
height:100%
font-size: 12px;
color: #FFFFFF; 
}
jofield is offline   Reply With Quote
Old 08-01-2012, 12:38 AM   PM User | #2
TylerB
New Coder

 
Join Date: Aug 2012
Location: Kalamazoo, MI
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
TylerB is an unknown quantity at this point
It views perfectly in IE for me. What version of IE are you using?
EDIT: Works in Firefox too.

And are your links on the right supposed to be very un-aligned?

Sorry for the size, I just did it real quick.


Last edited by TylerB; 08-01-2012 at 12:41 AM..
TylerB is offline   Reply With Quote
Old 08-01-2012, 06:58 PM   PM User | #3
jofield
New Coder

 
Join Date: Oct 2011
Location: Essex, England
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
jofield is an unknown quantity at this point
Hi TylerB
It was IE9 I was looking at it in and the main content box and the sidebar are overlapping, and it's even worse on my iPhone
jofield is offline   Reply With Quote
Old 08-01-2012, 07:46 PM   PM User | #4
TylerB
New Coder

 
Join Date: Aug 2012
Location: Kalamazoo, MI
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
TylerB is an unknown quantity at this point
Very weird, I too was viewing it in IE9. Try using percentages for the widths and margins.
TylerB is offline   Reply With Quote
Old 08-02-2012, 08:35 AM   PM User | #5
jofield
New Coder

 
Join Date: Oct 2011
Location: Essex, England
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
jofield is an unknown quantity at this point
How very strange! Okay I'll try giving percentages a go and see what happens! Thanks TylerB!

Also, can you see on the screengrab you took that below the top menu bar and left aligned there is a transparent box that has a slight border to it? This only displays in IE and not in FireFox and I cannot work out what it is to get rid of it It then seems to prevent selection of the items at the bottom of the longer dropdown items from the menu.

Do you have any idea what this is and how I can remove it please?

Thanks
jofield is offline   Reply With Quote
Old 08-10-2012, 12:09 PM   PM User | #6
jofield
New Coder

 
Join Date: Oct 2011
Location: Essex, England
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
jofield is an unknown quantity at this point
Ok I've managed to remove the weird header and have sorted some of the alignment issues I was having but am now trying to get to grips with using percentages instead of padding so that I don't have the overlapping issues in some versions of IE and on OS devices.

I've been doing a lot of googling and just wanted to check I'm on the right wavelength here:

To have two floating boxes as I do currently I will need to set up 5 columns in my page. Columns 1, 3 an 5 just containing empty space or a transparent gif or something similar and columns 2 and 4 containing my content. Would that be correct or is there a far simpler way that I'm missing?

Many thanks
jofield is offline   Reply With Quote
Reply

Bookmarks

Tags
alignment, css, wordpress

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:34 AM.


Advertisement
Log in to turn off these ads.