Web Design Forum: Inserting Text - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Inserting Text

#1 User is offline   Christina 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 02-April 09
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 06 April 2009 - 10:03 PM

I created a Div Tag for text in a box in my already designed layout. For some reason I can type only one line! When I hit the [Enter] key to go to the next line and check the Firefox browser for errors the layout is distorted, but in IE it's totally fine. How do I fix this?
0

#2 User is offline   dangreaves92 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 376
  • Joined: 25-September 08
  • Reputation: 2
  • Gender:Male
  • Location:Essex, UK
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 06 April 2009 - 10:06 PM

What application are you using to edit your pages?
0

#3 User is online   n0xx 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 24-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Poland
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 06 April 2009 - 10:07 PM

write text like this :

<div>
<span>
<p>this is your 1st line </p>
<p>this is your 2nd line </p>
</span>
</div>

This post has been edited by Sam G: 02 February 2010 - 08:54 PM
Reason for edit: added [code] tags

0

#4 User is offline   dangreaves92 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 376
  • Joined: 25-September 08
  • Reputation: 2
  • Gender:Male
  • Location:Essex, UK
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 06 April 2009 - 10:10 PM

This doesn't explain the layout distortion after simply inserting a line break. Also, the <span> tag in your example serves no purpose.
0

#5 User is offline   ElanMan 

  • In, out, shake it all about...
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,298
  • Joined: 11-March 08
  • Reputation: 54
  • Gender:Male
  • Location:Darlington
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 06 April 2009 - 10:36 PM

The <span> tags in the above example shouldn't be there at all. Inline elements containing block elements?
0

#6 User is offline   caraewilton 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 367
  • Joined: 24-October 08
  • Reputation: 0
  • Location:South Africa
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 07 April 2009 - 01:46 AM

Are you using floats? Can you give a link to the page? Or provide the html and css code?
0

#7 User is online   n0xx 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 24-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Poland
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 06:50 AM

im adding <span> if i will have more then 1 classes for a text, its easier then with typography.
0

#8 User is offline   mr p 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 325
  • Joined: 09-December 08
  • Reputation: 6
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 07 April 2009 - 09:13 AM

View Postn0xx, on Apr 7 2009, 06:50, said:

im adding <span> if i will have more then 1 classes for a text, its easier then with typography.



this makes no sense. if you want to style the text in that div differently to other divs, then just give the div or paragraphs a class.
0

#9 User is offline   bensd 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 51
  • Joined: 13-April 08
  • Reputation: 0
  • Location:Wiltshire, UK
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 07 April 2009 - 09:23 AM

View PostChristina, on Apr 6 2009, 23:03, said:

I created a Div Tag for text in a box in my already designed layout. For some reason I can type only one line! When I hit the [Enter] key to go to the next line and check the Firefox browser for errors the layout is distorted, but in IE it's totally fine. How do I fix this?

Link?
0

#10 User is online   n0xx 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 24-March 09
  • Reputation: 0
  • Gender:Male
  • Location:Poland
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 07 April 2009 - 09:30 AM

Quote

this makes no sense. if you want to style the text in that div differently to other divs, then just give the div or paragraphs a class.


What about if i have 3 text styles in 1 div ?
I dont like adding class or id to <p> so im adding to <span>.
That's my way to do it, thats all.
0

#11 User is offline   NeRo 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 824
  • Joined: 28-September 07
  • Reputation: 39
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 07 April 2009 - 09:35 AM

I'm guessing you're using something like Dreamweaver?

If at the end of a line, you press Enter, it closes the p tag. However, if you press Shift/Enter together it breaks onto a new line.
0

#12 User is offline   mr p 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 325
  • Joined: 09-December 08
  • Reputation: 6
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 07 April 2009 - 09:39 AM

View Postn0xx, on Apr 7 2009, 09:30, said:

What about if i have 3 text styles in 1 div ?
I dont like adding class or id to <p> so im adding to <span>.
That's my way to do it, thats all.


each to their own, but why don't you like adding a class or id to <p>?
0

#13 User is offline   Christina 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 02-April 09
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 09 April 2009 - 02:39 PM

View Postcaraewilton, on Apr 6 2009, 20:46, said:

Are you using floats? Can you give a link to the page? Or provide the html and css code?


I am not using floats. I imported my layout from photoshop and then selected the slice I want to put text in, deleted it and then created a div tag for it.

When I type in the first line it is fine, but when I push enter to type in the next line that's when it gets distorted. The slices are spread out.

Here is the CSS code:

<td solspan="5"><div id="product_content">
   <p>Product Groups</p>
   <p>&nbsp; </p>
</div></td>

This post has been edited by Sam G: 02 February 2010 - 08:55 PM
Reason for edit: added [code] tags

0

#14 User is offline   Christina 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 02-April 09
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 09 April 2009 - 04:55 PM

Hey Everyone!

I think I figured it out...unless it's a temporary fix. I guess we'll see.

I realized that I needed enter in the height of the div tag box After I enter in my text.

Thanks for all your help!

Christina
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users