Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
CSS Positioning - strange error
Old 11-09-2010, 09:34 AM CSS Positioning - strange error
Average Talker

Posts: 17
Trades: 0
Hi

I have designed a website for my friend and one page is giving me serious difficulty in terms of the positioning of the text.

The page can be found here:

http://www.stormoutdoorfitness.co.uk...ltraining.html

I have tested it in various browers and at various resolutions.

I can not work out why the text in the main body of the page displays incorrectly in some browsers at different resolutions and correctly at others.

Any help would be appreciated as I am going around in circles!
mabbutt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-09-2010, 10:01 AM Re: CSS Positioning - strange error
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
Ok that's some weird stuff going on there. From what I can see in Chrome's developer tools, I think you've overcomplicated this way too much.

Code:
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-image: none;
background-origin: padding-box;
color: white;
display: block;
font-family: Arial, Helvetica, sans-serif;
font-size: 21px;
font-weight: bold;
height: 91px;
line-height: 18px;
margin-bottom: 0px;
margin-left: 42px;
margin-right: 420px;
margin-top: 56px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
text-align: left;
width: 534px;
Most of that isn't necessary. If I were you, I would do this for those boxes:

HTML Code:
<div class="box">Stage 2 Big gains (5-8 Weeks)
Nutritional strategies and exercise become habitual. Start to see desired changes such as, clothes becoming looser and muscles toning. Family and friends noticing changes. Motivation is very high. Looking forward to every training session.Total fat loss between 8-16lbs.</div>
And then style like so:

Code:
.box { width: 500px; border: 1px solid #fff; padding: 20px; }
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 11-11-2010, 08:39 PM Re: CSS Positioning - strange error
gamer-goddess's Avatar
Average Talker

Posts: 18
Name: Nicholette
Trades: 0
As ed pointed out, separating properties can actually lead to cross browser issues.

For Example:
Code:
padding-bottom: 10px;
padding-left: 5px;
padding-right: 2px;
padding-top: 8px;
Should always be written as:
Code:
padding: 8px 2px 5px 10px;
(My browser of choice: Firefox, Resolution: 1680 x 1050)
I checked in Google Chrome, IE, Opera, Safari and Firefox
No issues in Firefox or IE, but I did see an issue in Google, Opera and Safari

Instead of using a break (< br >) I would try using display: block; on everything that needs to be stacked ontop of something else, and maybe even specify a margin-bottom if you need a little extra space between spans. Also keep in mind that header tags are easier to use and style for titles. (all those Orange classes could easily be headers
Code:
h1, h2, h3, h4, h5, h6 {
    font: Arial, Helvetica, sans-serif #f26722;  
    letter-spacing: 1px;
}

h1 { font-size: 24px; } // whatever sizes you want here, em's or px's
h2 { font-size: 20px; }
h3 { font-size: 18px; }
h4 { font-size: 14px; }
h5 { font-size: 12px; }
h6 { font-size: 10px; }
Also, you're naming your sections as separate classes, but they have identical properties (for the most part). Unless you plan on making each < p > look different from the other, I would just have one MainPT. I like to use a combination of class and id. For every section on my webpage that shares the same properties, I name one class and change the id where needed. (These colors are ugly combos, I know)

For Example:
Code:
...

.section {
    display: block;
    padding: 5px;
}

#Superman {
   border: 1px solid blue;
   background-color: red;
}

#Batman {
   border: 1px solid yellow;
   background-color: black;
}
</style>

<div class=section id=Superman><h2>Title</h2>blah blah blah</div>
<div class=section id=Batman><h2>Title</h2>blah blah blah</div>
My last piece of cross browser advice is to reset all your CSS and then style it.
Code:
/* ==================================================== 
   STYLE RESET
==================================================== */
html, body, div, span, applet, objects, iframe, h1, h2, h3, h4, h5, h6, blockquote, p, pre, a, abbr, acronyn, address, big, caption, 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, ol, ul, li, fieldset, form, label, legend, table, tbody, tfoot, thead, tr, th, td {
    background: none repeat scroll 0 0 transparent;    
    margin: 0;
    padding: 0;
    outline: 0 none;
    font-size: 100%;
    vertical-align: baseline;
}

ol, ul { 
    list-style: none outside none;
}

blockquote, q {
    quotes: none;
}

:focus {
    outline: 0 none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}
/* ==================================================== 
   MY STYLE
==================================================== */
BODY {
 ...
}
...

Last edited by gamer-goddess; 11-11-2010 at 09:03 PM..
gamer-goddess is offline
Reply With Quote
View Public Profile Visit gamer-goddess's homepage!
 
Old 11-13-2010, 03:16 AM Re: CSS Positioning - strange error
Average Talker

Posts: 17
Trades: 0
Edgray and gamer-goddess, thank you so much for replying and please accept my apologies for the time in which it has taken me to reply.

I am going to strip my code down and see if I can follow what you have said.

It is a great learning curve for me and hopefully I can keep CSS as simple as possible.

I really do appreciate all your help and advice!
mabbutt is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS Positioning - strange error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.40642 seconds with 12 queries