Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

[SOLVED] Can anyone help me with some simple css?

This is a discussion on "[SOLVED] Can anyone help me with some simple css?" within the Web Page Design section. This forum, and the thread "[SOLVED] Can anyone help me with some simple css? are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 14th, 2008, 15:13
Reputable Member
Join Date: Jul 2008
Location: cornwall
Age: 24
Posts: 148
Thanks: 18
Thanked 0 Times in 0 Posts
[SOLVED] Can anyone help me with some simple css?

Hi guys i am trying to redesign my website in css, but i am having a few probles,

firstly i am using divs to layout my pages but im having trouble adding a boarder around the div, the code i have used is
HTML: Select all
#wrapper {
 border:thick;
 border-color:#000000;
 margin: 0 auto;
 width:960px;
 height:525px;
}
then i use
HTML: Select all
<div id="wrapper">
to call the div
but no border appears, am i doing something wrong?

next, i cant seem to make text in a div appear verticaly central i can do horizontal center but not sure how to do vertical

any help and advice would be great
Thanks
Luke
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Jul 14th, 2008, 20:33
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,342
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Re: Can anyone help me with some simple css?

Try this:

Code: Select all
border: #000 thick solid;
As for the verticle center, try this:

Code: Select all
vertical-align:middle;
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
The Following User Says Thank You to CloudedVision For This Useful Post:
  #3  
Old Jul 14th, 2008, 22:00
Aso's Avatar
Aso Aso is online now
Moderator
Join Date: Oct 2007
Location: UK
Posts: 1,535
Blog Entries: 2
Thanks: 19
Thanked 81 Times in 76 Posts
Re: Can anyone help me with some simple css?

CV, I don't think vertical-align will solve the issue - vertical-align is for elements like images relative to the text within the same container.

If CV's border solution does not work, try a pixel value such as;
Code: Select all
border:1px solid #000
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 14th, 2008, 22:03
Reputable Member
Join Date: Jul 2008
Location: cornwall
Age: 24
Posts: 148
Thanks: 18
Thanked 0 Times in 0 Posts
Re: Can anyone help me with some simple css?

hi cloudedvision,

thanks for your help the border worked fine however the vertical alignment didn't here is a link to the page (minus ther border code, not uploaded yet )

http://www.kernow-connect.com/newwebsite.html

cheers
Luke
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 14th, 2008, 22:03
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,342
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Re: Can anyone help me with some simple css?

Quote:
Originally Posted by Aso View Post
CV, I don't think vertical-align will solve the issue - vertical-align is for elements like images relative to the text within the same container.
Oh. No wonder it never worked for me.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 14th, 2008, 22:05
Reputable Member
Join Date: Jul 2008
Location: cornwall
Age: 24
Posts: 148
Thanks: 18
Thanked 0 Times in 0 Posts
Re: Can anyone help me with some simple css?

Hi Aso,

is it not possible to vertically align text within a AP div, should i add a top margain to center it that way?

cheers for your time and help
Luke
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jul 14th, 2008, 22:11
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,342
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Re: Can anyone help me with some simple css?

what you could do is something like this:

Code: Select all
#div p {
line-height:100px; /* Div height */
verticle-align:center;
}
HTML: Select all
<div id="div">
<p>Hello there!  This is text!</p>
</div>
Haven't tested it out though.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jul 14th, 2008, 22:12
Aso's Avatar
Aso Aso is online now
Moderator
Join Date: Oct 2007
Location: UK
Posts: 1,535
Blog Entries: 2
Thanks: 19
Thanked 81 Times in 76 Posts
Re: Can anyone help me with some simple css?

Hi Luke,

Yeah, vertical alignment is one of CSS's major let-downs (perhaps it's addressed in CSS3?)

Anyway, if the height of div is fixed, you could add some top-padding. For example, if your div is 520px high, use;
Code: Select all
div {
height:260px;
padding:260px 0 0
}
Notice how the total of padding+height equals the *actual* height you want?

You might want to add a bit more height and take off the padding to allow for the natural height of the text.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)

Last edited by Aso; Jul 14th, 2008 at 22:27.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
The Following User Says Thank You to Aso For This Useful Post:
  #9  
Old Jul 14th, 2008, 22:21
Reputable Member
Join Date: Jul 2008
Location: cornwall
Age: 24
Posts: 148
Thanks: 18
Thanked 0 Times in 0 Posts
Re: Can anyone help me with some simple css?

Cheers guys all sorted, used Aso's method of adding padding, it seems to work ok,

appreciate your help
Luke
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Simple list problem CloudedVision Web Page Design 2 Jun 26th, 2008 03:20
[SOLVED] Simple Dynamic Links In PHP c0un7z3r0 PHP Forum 6 Jun 23rd, 2008 19:27
[SOLVED] simple layout problem saltedm8 Web Page Design 13 May 2nd, 2008 19:02
[SOLVED] simple div problem hhelen Web Page Design 5 Apr 4th, 2008 15:56
[SOLVED] Simple Php Code Problem longstand PHP Forum 3 Oct 17th, 2007 22:02


All times are GMT. The time now is 18:44.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8