12 replies [Last post]
Monkey
Monkey's picture
Offline
Regular
England
Last seen: 10 years 19 weeks ago
England
Timezone: GMT+1
Joined: 2009-09-25
Posts: 12
Points: 8

Hi all, new to the forums and css, so take it easy on me http://csscreator.com/sites/all/modules/smileys/packs/example/lol.png

Basically, im hoping this will be pretty straight forward, I have a page that im working on www.waxpigeon.com, and all im trying to do is make the black bar in the middle of the page, be as near to the middle as possible when resizing windows and viewing site in different resolutions

And all i want to know really is, is this possible with css?

Thanks in advance for any advice/pointers

t-bone
Offline
newbie
Los Angeles
Last seen: 10 years 45 weeks ago
Los Angeles
Joined: 2009-09-25
Posts: 10
Points: 0

Solution

Untitled Document

html>body #negro
{
positiion:absolute;
margin: 10% 0 0 0;
width:110%;
height:300px;
background-color:black;
}
html>body .silly_man
{
position:absolute;
margin: 50px 0 0 30%;
font-family:Arial, Helvetica, sans-serif;
font-size:100px;
color:white;
}

I Spray Tinactin on My Balls

Monkey
Monkey's picture
Offline
Regular
England
Last seen: 10 years 19 weeks ago
England
Timezone: GMT+1
Joined: 2009-09-25
Posts: 12
Points: 8

No need to be so crude

No need to be so crude Tongue

Well it works to a certain extent, thanks for that, ill try and refine it to get it to work how i would like, ill let you know

t-bone
Offline
newbie
Los Angeles
Last seen: 10 years 45 weeks ago
Los Angeles
Joined: 2009-09-25
Posts: 10
Points: 0

Good Luck

Start breaking your style sheets off to separate css documents.

Here is the code I use to pick them up. It will pull style.css into the right browser. You have to generate style-ie.css for IE<8. It is not that difficult but a whole new ball of wax.

var browser_type = navigator.appName;
var pattern = /MSIE 8.0/;
if (!pattern.test(navigator.appVersion) && browser_type == "Microsoft Internet Explorer") {
document.write("");
}
else {
document.write("")
}

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 4 years 47 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

t-bone wrote:Start breaking

t-bone wrote:

Start breaking your style sheets off to separate css documents.

Here is the code I use to pick them up. It will pull style.css into the right browser. You have to generate style-ie.css for IE<8. It is not that difficult but a whole new ball of wax.

var browser_type = navigator.appName;
var pattern = /MSIE 8.0/;
if (!pattern.test(navigator.appVersion) && browser_type == "Microsoft Internet Explorer") {
document.write("");
}
else {
document.write("")
}

Wait, what? Are you calling a different style sheet to be used in IE with JS?

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 4 years 33 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

Yes

Yes. I am using javascript to dictate between two different stylesheets based on what browser the user has.

Those calls are made by a team of programmers who analyze things such as the percentage of users with java and such.

I don't write the code or make that call. I don't code with C sharp or generate all the real coding language to actually develop software programs.

We do well. So I trust my team. I am also familiar with the argument and it was discussed in a meeting prior to implementing the code.

Thanks!

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 4 years 47 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

You should research

You should research conditional statements. It's a non-JS way of calling style sheets.

<!--[if lt IE 6]>
<link rel="stylesheet" type="text/css" media="all" href="ie5.css" />
<![endif]-->

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 4 years 33 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

IE 8

That methodology no longer is relevant when dealing with IE8.

I looked over your site and actually bypassed your update page and the stuff falls apart in older versions of IE. It is really not that complicated. You don't have to try and get the person to do a software update. Chances are they won't.

Just serve the content. Use that code. Generate a stylesheet called style-ie.css and something like supersleight to make your png's transparent and you can probably have your site looking the same in IE 6, 7 and 8 in a half an hour.

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 4 years 47 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

t-bone_two wrote:That

t-bone_two wrote:

That methodology no longer is relevant when dealing with IE8.

I looked over your site and actually bypassed your update page and the stuff falls apart in older versions of IE.

I'm proactive and dont code for older ie browsers, thats why the update is there. If everybody would stop coding for non-supportive browsers, people would get their stuff up-to-date. Some disagree, some dont.

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 4 years 33 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

I agree with you

If I could abolish every IE browser prior to 8 I would.

The facts are that people take paths of least resistance. People who study CTR and such tell me profit margins are based on giving a user a path with no resistance.

I would love to code for just the most recent browser and hope the user would do the extra work to see things optimally. But my advisors tell me it's not a fiscally responsible solution.

And the company results warrant following their lead.

And I just gotta say. I am a pretty big fan of money.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 30 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Stop with this advice about

Stop with this advice about browser sniffing it has and remains bad advice that is never recommended.

Conditional comments are the method used to provide - where necessary - specific and isolated rules to various IE versions.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Monkey
Monkey's picture
Offline
Regular
England
Last seen: 10 years 19 weeks ago
England
Timezone: GMT+1
Joined: 2009-09-25
Posts: 12
Points: 8

Well thanks for the help

Well thanks for the help anyway t-bone, and i normally do use external stylesheets, but i designed this site all in html, gonna be making it all refer to css where needed but its a very basic site and it not gonna have alot more info when done

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 4 years 33 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

My only point

Is that some of that breaks down when dealing with IE8 in the methond I am used to dealing with.

IE8 will grab style-ie. Not style.css