Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Another) question about html and css
#1
Hopefully the solution isn't too complicated, but how do I center the content of my webpage so that it's centered on all screen resolutions?
Something may look centered on my screen, but if I send the site to anyone else, it's totally off.

Here's what it looks like now:
 Spoiler

I also tried using the 'rigid' method as mentioned here: http://www.dreamweaverclub.com/css-center-content.php
but when I do, it shifts the tabs at the top, whereas I'd like to keep those on the top left of the page.

If needed, here is my code (forgive me if it's messy ;-; I kinda really suck at coding)

 Spoiler

And the accompanying css:
 Spoiler
Reply
#2
I typically use the "rigid method" and it works just fine.
Reply
#3
Zelkova Wrote:I typically use the "rigid method" and it works just fine.

I can use that, and it looks fine in chrome, but not in firefox.
Although the above mentioned site offers a solution for it, it makes it look okay in firefox, but not in chrome.

chrome: http://puu.sh/2s0TS
firefox: http://puu.sh/2s0Uj
Reply
#4
There's no if logic to save you is there?
Reply
#5
Takebacker Wrote:There's no if logic to save you is there?

I guess not. Considering your sentence makes no sense to begin with.

Sorry for asking for help concerning a subject that I've stated many times that I do not understand and easily get confused by.
If you have nothing productive to contribute, then please leave.
Reply
#6
icephoenix21 Wrote:I guess not. Considering your sentence makes no sense to begin with.

Sorry for asking for help concerning a subject that I've stated many times that I do not understand and easily get confused by.
If you have nothing productive to contribute, then please leave.

I was trying to help...considering i'm in the middle of building two websites i figured we might be able to learn something. Until that post, anyway...

I was wondering if an if statement would help. I'm just using center tags for my images so far and i can't decipher much of css.
Reply
#7
Takebacker Wrote:I was trying to help...considering i'm in the middle of building two websites i figured we might be able to learn something. Until that post, anyway...

I was wondering if an if statement would help. I'm just using center tags for my images so far and i can't decipher much of css.

Ah, it sounded like some sarcasm to me, as in 'you have no logic to save you, do you', because I've never heard of an 'if statement' before.
I even asked two others what they thought you meant :S
In that case, my apologies.
Reply
#8
Keep your .body the way it is. You need to define a style for .h4 (what you're using for the links) that overrides the body.

Code:
.h4
{
    text-align: left;
}
Reply
#9
icephoenix21 Wrote:Hopefully the solution isn't too complicated, but how do I center the content of my webpage so that it's centered on all screen resolutions?
Something may look centered on my screen, but if I send the site to anyone else, it's totally off.

Here's what it looks like now:
 Spoiler

I also tried using the 'rigid' method as mentioned here: http://www.dreamweaverclub.com/css-center-content.php
but when I do, it shifts the tabs at the top, whereas I'd like to keep those on the top left of the page.

If needed, here is my code (forgive me if it's messy ;-; I kinda really suck at coding)

 Spoiler

And the accompanying css:
 Spoiler

[Image: 2o7t5hB.gif] Pretty much sums up everything you're trying to do!
Reply
#10
icephoenix21 Wrote:Ah, it sounded like some sarcasm to me, as in 'you have no logic to save you, do you', because I've never heard of an 'if statement' before.
I even asked two others what they thought you meant :S
In that case, my apologies.

I think he was referring to an "if" or "if / else" statement. A quick google search brought this to light.

http://www.quirksmode.org/css/condcom.html

I personally have only used this once or twice, and it was to redirect IE users Heart
Reply
#11
Zelkova Wrote:I think he was referring to an "if" or "if / else" statement. A quick google search brought this to light.

http://www.quirksmode.org/css/condcom.html

I personally have only used this once or twice, and it was to redirect IE users Heart

Ah, I see. That makes a bit more sense. I wish it were for firefox. I'm not so much concerned with IE, though since a majority of people do not use it.
Reply
#12
Takebacker Wrote:I was trying to help...considering i'm in the middle of building two websites i figured we might be able to learn something. Until that post, anyway...

I was wondering if an if statement would help. I'm just using center tags for my images so far and i can't decipher much of css.

To be fair it did seem like you were calling her stupid when I first read it too LOL. Like "There's no logic to save you is there". USE QUOTATIONS BRO.
Reply
#13
Sorry for thinking ifs are like the most fundamental coding structure that everyone should know before knowing what code even looks like. :/
Reply
#14
Takebacker Wrote:Sorry for thinking ifs are like the most fundamental coding structure that everyone should know before knowing what code even looks like. :/

I don't believe there are if statements in CSS and HTML. JavaScript and PHP obviously have them though.
Reply
#15
Locked Wrote:I don't believe there are if statements in CSS and HTML. JavaScript and PHP obviously have them though.

Not natively yeah. It is like zelkova said, for checking browser version. I didn't know if it could go beyond that though but i threw it out there anyway. You can do php within html with <? > i think (or <?-- --> don't remember)
Reply
#16
Takebacker Wrote:Not natively yeah. It is like zelkova said, for checking browser version. I didn't know if it could go beyond that though but i threw it out there anyway. You can do php within html with <? > i think (or <?-- --> don't remember)

<?php

?>
Reply
#17
Locked Wrote:I don't believe there are if statements in CSS and HTML. JavaScript and PHP obviously have them though.

Conditional comments exist, but yeah HTML and CSS are not code, so there is no branching logic.

Of course, you still have conditions. A CSS document tells your browser "if the content is a paragraph, display it this way. if it is a level 3 header, display it that way." And your body definition is an else catch-all that tells the browser how to display things that don't have a specific definition.
Reply
#18
Zelkova Wrote:<?php

?>

Ohhhh i see i was seeing this

Code:
<!--[if lte IE 6]>
<link href="path here" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if IE 7]>
<link href="path here" rel="stylesheet" type="text/css" />
<![endif]-->

and got confused. Sorry.
Reply
#19
Another question, if I'm making a type of 'Terms of Service agreement' anyone know what I would put in the javascript so that after they hit the 'I accept' box, it would redirect them to the next page? This is the coding I have:

 Spoiler
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)