SitePoint Sponsor |
|
User Tag List
Results 1 to 15 of 15
Thread: Layers line breaking
-
May 3, 2001, 16:20 #1
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hello
doing a sort of news window where i am dynamically reading the text into a layer and was wondering was there any way to keep a layer at its predefined width so that text will automatically break the line when it comes to the right edge of the layer?
any help appreciated!
Garrett
-
May 3, 2001, 16:28 #2
- Join Date
- Oct 2000
- Location
- Austin, TX
- Posts
- 1,438
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
width: 300px maybe?
-
May 3, 2001, 16:38 #3
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yes that sets the width of the layer but text within the layer does'nt break the line! instead it carries on off right of the layer.
Garrett
-
May 3, 2001, 17:01 #4
- Join Date
- Oct 2000
- Location
- Austin, TX
- Posts
- 1,438
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
overflow: auto should work.
-
May 3, 2001, 17:09 #5
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
nope that gives scrollbars and still does'nt break the line.
Garrett
-
May 3, 2001, 17:15 #6
- Join Date
- Oct 2000
- Location
- Austin, TX
- Posts
- 1,438
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
phffft
-
May 3, 2001, 17:19 #7
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
and i dont think 'phffft' is a valid css tag!
Garrett
-
May 4, 2001, 01:22 #8
- Join Date
- Feb 2001
- Location
- Stockport, UK
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Set a class for your <p> tag width: 280px. Lines should wrap then
-
May 4, 2001, 04:06 #9
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
not quite sure what you mean?
<p style="width: 280px;"></p>
a style like this?
Garrett
-
May 4, 2001, 04:19 #10
- Join Date
- Feb 2001
- Location
- Stockport, UK
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, but you could define it first to cut down on code.
<style type="text/css">
p {width: 280px}
</style>
Would give every paragraph a width of 240px.
Or
<style type="text/css">
p.narrow {width: 280px}
</style>
then in your text;
<p class="narrow">Some text that will wrap round when it gets to 240pixels</P>
Only <p> tags with a class of narrow will be affected all others will act as normal.
Hope this helps
-
May 4, 2001, 04:47 #11
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
p {width: 100px;
font-size: 9px;
}
</style>
</head>
<body bgcolor="#FFFFFF">
<p>
dfjkdlfjkdjfkjdkfkdfjkldjfkdjfkdkfjkldjfkjdklfjkdfjkdjfkdjfkdjfkjdfkljdkfjkldfjkdjfkdjfkjdfkl
</p>
</body>
</html>
------------------------------
my code! the width does'nt seem to do anything? i know the style sheet works fine cos i stuck in the font-size and no problem!
Garrett
-
May 4, 2001, 05:15 #12
- Join Date
- Feb 2001
- Location
- Stockport, UK
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Garret,
you just need some spaces in the line of text. The browser thinks all those djfk's are one word so won't wrap them.
Here is an exmple of the class thing
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
p {width: 75%;
font-size: 9px;
}
p.narrow {width: 200px;
font-size: 1em
}
p.narrower {width: 100px;
font-size: 1em
}
</style>
</head>
<body bgcolor="#FFFFFF">
<p>The quick brown fox jumped over lazey dog. Mary had a little lamb. The quick brown fox jumped over lazey dog. Mary had a little lamb.The quick brown fox jumped over lazey dog. Mary had a little lamb.The quick brown fox jumped over lazey dog. Mary had a little lamb.
</p>
<p class="narrow">The quick brown fox jumped over lazey dog. Mary had a little lamb. The quick brown fox jumped over lazey dog. Mary had a little lamb.The quick brown fox jumped over lazey dog. Mary had a little lamb.The quick brown fox jumped over lazey dog. Mary had a little lamb.</p>
<p class="narrower">The quick brown fox jumped over lazey dog. Mary had a little lamb. The quick brown fox jumped over lazey dog. Mary had a little lamb.The quick brown fox jumped over lazey dog. Mary had a little lamb.The quick brown fox jumped over lazey dog. Mary had a little lamb.</p>
</body>
</html>
-
May 4, 2001, 05:42 #13
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
doh! ok sorry for being so silly!
heres what i've been doing
http://www.intimacyandloneliness.f2s...nts/index.php3
thanks for your help
Garrett
-
May 4, 2001, 06:21 #14
- Join Date
- Feb 2001
- Location
- Stockport, UK
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Site looks good, heavy subject! Good luck with the research.
Need anymore help just ask
-
May 4, 2001, 06:55 #15
- Join Date
- Feb 2001
- Location
- England
- Posts
- 352
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks you've been very helpfull!
Garrett
Bookmarks