![]() |
|
||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||
|
|
#1 |
|
WLC Member
Join Date: Apr 2011
Posts: 16
|
I've run into an issue of needing to force a phrase, in this case a headline, to the next line if it's longer than 150px.
I've looked at word wrap, but it seems to me that is for one long word, url, or set of numbers(ie- without a break). I'm using the following code to no avail: Code:
#main article .postinfo {
list-style-type: none;
margin-left: ;
width: 150px;
word-wrap:break-word;
}
Last edited by achenn; 21st March 12 at 07:27 PM. |
|
|
|
|
|
#2 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
You cannot have a space in a identifier name or you have missed a '#' or a '.' before 'article'.
Also you should not leave empty values in your ruleset. Is the container used a block or an inline element? |
|
|
|
|
|
#3 |
|
WLC Member
Join Date: Apr 2011
Posts: 16
|
Mistakes corrected, problem persists. Also, I've tried both inline and block.. didn't seem to make a difference.
Code:
#main {
float: left;
margin-left: 315px;
margin-top: 310px;
}
#main #article .postinfo {
list-style-type: none;
width: 150px;
word-wrap:break-word;
}
#main #article p {
float: right;
margin-top: -85px;
margin-left: 230px;
width: 403px;
}
|
|
|
|
|
|
#4 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
So do we get to see the HTML that the CSS is applied to?
One is of no use without the other AND to diagnose display or visual problem we need to SEE the problem, preferably in situ. |
|
|
|
|
|
#5 |
|
WLC Member
Join Date: Apr 2011
Posts: 16
|
Ah, everything has been broken down into php- it will function as a Wordpress theme when all is said and done.
Here is the corresponding php, though I'm not sure what good it'll do. PHP Code:
|
|
|
|
|
|
#6 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
If it is for wordpress why not set up an account on wordpress.com and upload the theme there.
or if you are testing locally copy and paste the rendered source code and put it on a free host somewhere. |
|
|
|
|
|
#7 |
|
WLC Member
Join Date: Apr 2011
Posts: 16
|
Thanks for the rendered source tip, I didn't know that was an option.
Anyway, here is the live site using the rendered source code. http://www.achenn.byethost7.com/
|
|
|
|
|
|
#8 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
First off, the problem is being created by not understanding positioning fully.
By using fixed positioning and trying to correct the natural flow by using margins, you throw the rest of the document out. If you really must have the fixed sidebar put it in a positioned element (relative) that is as wide as or wider than the sidebar, the fixed elements will still work as they should but the normal flow will be left intact. |
|
|
|
|
|
#9 |
|
WLC Member
Join Date: Apr 2011
Posts: 16
|
Sorry to have to do this to you, but I guess I don't fully understand what you mean. Could you give an example?
|
|
|
|
|
|
#10 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
I explain, hopefully clearly, how fixed position elements can break out of their positioned parent that remains in the document flow and display elsewhere on the page.
If you are going to use positioning it is important that you understand how it actually works first, so that it doesn't 'mess up' the rest of the layout. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
Linear Mode |
|
|