Web Design Forum: CSS question - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CSS question

#1 User is offline   Rich W 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 02-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Brum
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 07 April 2009 - 05:43 PM

Hi all,

I've designed a site using css but when I change the size of the browser window it moves everything out of position.

Can anyone tell me how I can prevent this from happening? It's a 2 column liquid layout. I can post the code when I get home tonight if that would help.

Cheers....Rich
0

#2 User is offline   Guezala 

  • Not an expert, just talk a lot...
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,504
  • Joined: 28-August 08
  • Reputation: 11
  • Gender:Female
  • Location:Midlands
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 06:01 PM

Def need to see code first Rich.... :D
0

#3 User is offline   Rich W 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 02-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Brum
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 07 April 2009 - 06:30 PM

Cool, see the attachment....

Attached File(s)


0

#4 User is online   n0xx 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 24-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Poland
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 06:36 PM

html ?...
0

#5 User is offline   rosiesp 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 290
  • Joined: 17-November 08
  • Reputation: 1
  • Gender:Male
  • Location:lundn
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 06:41 PM

Hi,

try changing:

#rightnav
{
float: right;
width: 400px;/* floats the right nav to the right and sets the width */
margin: 0;
padding: 1em; /* moves the text away from the edges of the div */

}

#content
{
margin-right: 400px;
padding: 1.5em;
}


to:

#rightnav
{
float: right;
width: 48%;/* floats the right nav to the right and sets the width */
margin: 0;
padding: 1em; /* moves the text away from the edges of the div */

}

#content
{
margin-right: 46%;
padding: 1.5em;
}


you may need to tweak the percentages to take account of the padding. At the moment the widths are in px and so won't resize with the window
0

#6 User is offline   Rich W 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 02-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Brum
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 07 April 2009 - 06:41 PM

Sorry quite new to this lol....

Attached File(s)


0

#7 User is offline   Rich W 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 02-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Brum
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 07 April 2009 - 06:44 PM

Cheers rosiesp, I'll give that a try.
0

#8 User is online   n0xx 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 24-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Poland
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 06:46 PM

will be easier for you if you will set width of container in px's not in %
0

#9 User is offline   rosiesp 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 290
  • Joined: 17-November 08
  • Reputation: 1
  • Gender:Male
  • Location:lundn
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 06:46 PM

View PostRich W, on Apr 7 2009, 19:44, said:

Cheers rosiesp, I'll give that a try.


try this html. I fiixed it and made it valid (xhtml strict).

Attached File(s)


0

#10 User is offline   Rich W 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 02-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Brum
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 07 April 2009 - 07:18 PM

View Postrosiesp, on Apr 7 2009, 19:46, said:

try this html. I fiixed it and made it valid (xhtml strict).


Works perfectly, how did you do it? what's xhtml strict?

Cheers for all your help.
0

#11 User is offline   rosiesp 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 290
  • Joined: 17-November 08
  • Reputation: 1
  • Gender:Male
  • Location:lundn
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 07:29 PM

View PostRich W, on Apr 7 2009, 20:18, said:

Works perfectly, how did you do it? what's xhtml strict?

Cheers for all your help.


html comes in four main variants, one of which is xhtml strict. see w3c schools.

to see what I did just open up both versions of the html file and see the differences
0

#12 User is offline   EX-Ian 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 06-April 09
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:Designer/Coder

Posted 08 April 2009 - 05:15 PM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

this code is to center your css that's what I know ^^

dont forget to put this code in your html ^^

yeah w3school is good..
0

#13 User is offline   dangreaves92 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 376
  • Joined: 25-September 08
  • Reputation: 2
  • Gender:Male
  • Location:Essex, UK
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 08 April 2009 - 07:40 PM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

That doesn't center your CSS. That line basically instructs your browser that the following code is written in XHTML Strict. Basically, each "type" of HTML has slightly different rules and ways in which it is displayed. The language is the same, just with slight differences. If possible, you should always use XHTML Strict as it forces you to write clean, well formatted code.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users