d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Div + Css Problem
12Next
Add Reply New Topic New Poll
Member
Posts: 8,635
Joined: Dec 28 2007
Gold: 87.00
May 22 2012 01:29am
So I have a parent div and inside the parent there are children divs.

I want my divs to look like this:
Code
[[text part1][text part2][text part 3]
[text part 4][text part5][text part6]]

But I'm getting this:
Code
[[text part1][text part2][text part 3][text
[text part5][text part6]               part4]]

How should I set up the css so it works like I want it to work?

This post was edited by vittujenkevat on May 22 2012 01:30am
Member
Posts: 8,635
Joined: Dec 28 2007
Gold: 87.00
May 22 2012 03:01am
Seems to work fine with mozilla but causing problems in IE. Any suggestions to fix this?
Member
Posts: 14,235
Joined: Apr 20 2007
Gold: 15.00
May 22 2012 04:13am
post your code and we'll figure out
Member
Posts: 8,635
Joined: Dec 28 2007
Gold: 87.00
May 22 2012 05:59am
Basicly something like this:

Code

<div id="con">
<div id="item">Item part1</div>
<div id="item">Item part2</div>
<div id="item">Item part3</div>
<div id="item">Item part4</div>
<div id="item">Item part5</div>
<div id="item">Item part6</div>
</div>

#con{
width:300px;
}
#item{
text-align: center;
float: left;
padding: 2px 7px;
text-transform: capitalize;
}


I did not test it with this, but it is written like the code in page, css is identical.
Member
Posts: 2,736
Joined: Nov 28 2009
Gold: 34.00
May 22 2012 06:15am
Quote (vittujenkevat @ 22 May 2012 12:59)
Basicly something like this:
I did not test it with this, but it is written like the code in page, css is identical.


I facepalmed when I read that, come on, don't post shit you didn't test. Here you're asking US to give a shit, and you barely give one yourself.
http://jsfiddle.net/fbZHy/1/

You can only have one id per page, unless you're daft, you should know that.
Member
Posts: 8,635
Joined: Dec 28 2007
Gold: 87.00
May 22 2012 07:49am
Quote (eagl3s1ght @ 22 May 2012 14:15)
I facepalmed when I read that, come on, don't post shit you didn't test. Here you're asking US to give a shit, and you barely give one yourself.
http://jsfiddle.net/fbZHy/1/

You can only have one id per page, unless you're daft, you should know that.
http://localhostr.com/files/jFiZEaX/capture.png


If I had the time to test it I would of done so, but I didnt have time. Anyways the code is made by some worker who isnt working on the company anymore and I'm not so familiar with web developin.
Member
Posts: 2,736
Joined: Nov 28 2009
Gold: 34.00
May 22 2012 08:29am
Quote (vittujenkevat @ 22 May 2012 14:49)
If I had the time to test it I would of done so, but I didnt have time. Anyways the code is made by some worker who isnt working on the company anymore and I'm not so familiar with web developin.


http://www.jsfiddle.net/
Takes you 1 minute to test that code. Perhaps you didn't have 1 minute?

Did you see solution I gave you?

This post was edited by eagl3s1ght on May 22 2012 08:30am
Member
Posts: 8,635
Joined: Dec 28 2007
Gold: 87.00
May 22 2012 12:08pm
Quote (eagl3s1ght @ 22 May 2012 16:29)
http://www.jsfiddle.net/
Takes you 1 minute to test that code. Perhaps you didn't have 1 minute?

Did you see solution I gave you?


I have never used that site so didnt even know you can test it like that.

Checked it now as didnt have time earlier, and yes it works as I want (atleast on my computer, have to check it out tomorrow at work) after I removed the width from class.

Code

#con{
   width: 400px;
}
.item{
   float: left;
   border: 1px solid red;
   border-style: inset;
   overflow: hidden;
   padding: 2px 7px;
   text-transform: capitalize;
}
.clear{
   clear: both;  
}


What does the clear property do?

Thanks for your time.
Member
Posts: 62,873
Joined: Aug 2 2009
Gold: 1,189.90
May 22 2012 12:27pm
Quote (vittujenkevat @ May 22 2012 11:08am)
I have never used that site so didnt even know you can test it like that.

Checked it now as didnt have time earlier, and yes it works as I want (atleast on my computer, have to check it out tomorrow at work) after I removed the width from class.

Code
#con{
   width: 400px;
}
.item{
   float: left;
   border: 1px solid red;
   border-style: inset;
   overflow: hidden;
   padding: 2px 7px;
   text-transform: capitalize;
}
.clear{
   clear: both;  
}


What does the clear property do?

Thanks for your time.


The clear property will force the element with clear under a floated element with the same value.

So if element1 has float:left, and element2 has clear:left, element2 will be forced under element1.
If element1 has float:left, and element2 has clear:both, element2 will be forced under element1 as well.
Now, if element1 has float:left, and element2 has clear:right, element2 will not be forced under element1.
Member
Posts: 2,736
Joined: Nov 28 2009
Gold: 34.00
May 22 2012 02:00pm
Quote (vittujenkevat @ 22 May 2012 19:08)
I have never used that site so didnt even know you can test it like that.

Checked it now as didnt have time earlier, and yes it works as I want (atleast on my computer, have to check it out tomorrow at work) after I removed the width from class.


So this is what you want?



Doubtful. How very lost are you?
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll