Current location: Hot Scripts Forums » General Web Coding » CSS » div css

div css

Reply
  #1 (permalink)  
Old 09-11-08, 01:12 PM
theighost theighost is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
div css

i am new to css and i kind of hate it now, maybe someone will make me love it.

i have very urgent questions about a div class:

I want to do the following to a div and i need the right css:

1. I need the boder of the div to start with a white line and after the white line comes a gray one.

2.i need the div to be of a specific width and at the same time to be in the center of the page, this div will be the whole page in fact, but it will not be the width of the screen and it WILL be in the centre.

3.if i write any long text in the div, longer than the div, i need that text to continue in the div, not go continuing outside of the div.

btw this div will contain other divs that will contain form inputs.

someone please help. i am getting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-12-08, 02:42 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community VIP
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 2,724
Thanks: 0
Thanked 0 Times in 0 Posts
1: you need to explain a little more what you're trying to do. Are you trying to make a gradient border?

2: this is the solution:
CSS Code:
  1. .myDiv {
  2.   position:relative;
  3.   margin:0 auto;
  4.   width:500px;
  5. }

3: this will do the trick:
CSS Code:
  1. .myDiv {
  2.   overflow:auto;
  3. }
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

If you want to add me on any IM, pm me first
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-12-08, 03:08 AM
theighost theighost is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
1st thanx.

second. what i am trying to do is to make a registration form, this form will not be as wide as the screen, instead it will be thiner and in the center of the page. this form will be in a big div that also contains other smaller divs.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 09-12-08, 03:14 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community VIP
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 2,724
Thanks: 0
Thanked 0 Times in 0 Posts
uhu, I understood that part, but what I meant was: what do you mean with the white border and the gray border?

You see: it's impossible to assign 2 border colors on the same element (on the same side of the div), so if you want to create a gradient border, you'll have to use several divs, or use an image
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

If you want to add me on any IM, pm me first
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 09-12-08, 04:00 AM
theighost theighost is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
hmm i get your point, i think i need to make another div. thnx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 09-12-08, 04:05 AM
theighost theighost is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
hey a problem, when i use the overflow:auto; if the text is too long a scroll bar appears, i would like the text to continue in the next line (like put a <br> tag)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 09-12-08, 04:07 AM
theighost theighost is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
lol sorry the problem solved as i have white-space:nowrap; in the css file
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 09-12-08, 06:28 AM
theighost theighost is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
i have another question, i know i am getting a pain.

in a div there is a small picture i write a long text next to it, so the text goes to a new line, the text that goes into the new line starts just under the picture, i want it to start under the other text's point of start, sorry about this bad explanation but the question is a bit hard to explain
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 09-12-08, 07:17 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 2,651
Thanks: 0
Thanked 21 Times in 21 Posts
If you float your image then the text will wrap around it.

In this example I am floating the image left.
HTML Code:
<html>
<head>
<style>
body
{
 background:#000;
 }
.container
{
 border:4px solid #fff;
 width:508px;
 }
.myDiv
{
 border:4px solid #ccc;
 background:#fff;
 width:500px;
 height:500px;
 padding:10px;
 text-align:justify;
 overflow:auto;
 }
.myImg
{
 float:left;
 margin-right:15px;
 margin-bottom:5px;
 }
</style>
</head>
<body>
<div class="container">
 <div class="myDiv">
  <img class="myImg" sec="" width="200px" height="200px">
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
 </div>
</div>
</body>
</html>
And in this example I am floating the image right.
HTML Code:
<html>
<head>
<style>
body
{
 background:#000;
 }
.container
{
 border:4px solid #fff;
 width:508px;
 }
.myDiv
{
 border:4px solid #ccc;
 background:#fff;
 width:500px;
 height:500px;
 padding:10px;
 text-align:justify;
 overflow:auto;
 }
.myImg
{
 float:right;
 margin-left:15px;
 margin-bottom:5px;
 }
</style>
</head>
<body>
<div class="container">
 <div class="myDiv">
  <img class="myImg" sec="" width="200px" height="200px">
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
  This is some text that I want to wrap around the image.
 </div>
</div>
</body>
</html>
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 09-12-08, 10:22 AM
theighost theighost is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
well actually i don't want to wrap the text around the image.
i will give u the example

::::::::text text text
::::::::text text text
::::::::text text text
(empty)text text text
(empty) text text text

i don't want it to look like this

:::::: text text text
:::::: text text text
:::::: text text text
text text text text

the points represent the image
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 CSS Div Height koncept CSS 2 09-22-07 01:00 PM
div and css problem nicpon CSS 5 09-03-06 10:38 PM
Can't Understand java script maverickminds JavaScript 1 07-16-06 02:23 PM
CSS Div problem themanmathias CSS 1 09-29-05 09:05 PM
CSS Div + Span help Arctic CSS 5 07-20-05 05:27 PM


All times are GMT -5. The time now is 04:05 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.