Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Italics causes div to misbehave?
Old 03-26-2006, 05:09 AM Italics causes div to misbehave?
wyrde's Avatar
Novice Talker

Posts: 5
Trades: 0
It's the wierdest thing, and I can't figure it out, so I'm asking:

I have a 2nd column that is setup on my stylesheet as a div.

If I use italics for a paragraph, i.e., starting immetidately after the paragraph code (<p>), and if it also ends at a code (this time <br />, or previously </p>), it ignores the div column, and continues the text as column one?

eg.

<p><i>blah blah blah blah</i><br />

or

<p><i>blah blah blah blah</i></p>

I am using coffeecup software to create my pages, maybe it has something to do with that, although I can't figure out how, but then, why should character formatting in any way affect a css div that occurs paragraphs before it on the page is what has me stumped to begin with.

<sigh>

Any ideas?
wyrde is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-26-2006, 06:49 AM Re: Italics causes div to misbehave?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You have probably missed off a closing tag somewhere, as in your first example with the missing </p>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-26-2006, 02:17 PM Re: Italics causes div to misbehave?
pipers dragon's Avatar
Extreme Talker

Posts: 190
Trades: 0
Correct me if I am wrong, nd this post probably won't fix your problem, but Isnt <p> a self closing tag? I have never had to close it with </p> and from all the tutorialss and thing I read wehn I was learning html, I didnt even realize that </p> was a legitimate tag.. I learned something new today.

But we might be ble to help more if you posted the code thats giving you trouble.
pipers dragon is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 12:09 AM Re: Italics causes div to misbehave?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
In XHTML, the </p> tag is required.

wyrde: have you tried something like this?
Code:
<p style="font-style:  italic">Your stuff here</p>
Try that (make sure you spell it the way I spelled it here, not italics.)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-27-2006, 01:01 AM Re: Italics causes div to misbehave?
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
And when you are using css. It is even more important to close all tags.
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-27-2006, 06:32 AM Re: Italics causes div to misbehave?
amygdela's Avatar
Super Talker

Posts: 111
Trades: 0
that's not true. The <p> tag CAN be closed, but is not required. not even in XHTML.
__________________

Please login or register to view this content. Registration is FREE
amygdela is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 09:05 AM Re: Italics causes div to misbehave?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yes a <p> does not need a closing tag

However in this case (should anyone read the original post fully, in particular this bit
Quote:
I have a 2nd column that is setup on my stylesheet as a div
)

A <p> element cannot contain any block level elements, so when the paragraph is NOT closed it will actually contain the 2nd column <div>

Hey Presto! instant error.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-27-2006, 10:26 AM Re: Italics causes div to misbehave?
wyrde's Avatar
Novice Talker

Posts: 5
Trades: 0
The thing is, and I double-triple checked this, I did have all the closing tags, both </i> and </p> (which I use by habit, since programming can be so finicky I'd rather have xtra than not enuff).

However, the ---
<p style="font-style: italic">Your stuff here</p>
--- suggestion should solve my problem handily.

Thanks for your comments and help!

Wyrde
wyrde is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 01:28 PM Re: Italics causes div to misbehave?
Extreme Talker

Posts: 170
Location: Canada
Trades: 0
Quote:
Originally Posted by pipers dragon
Correct me if I am wrong, nd this post probably won't fix your problem, but Isnt <p> a self closing tag? I have never had to close it with </p> and from all the tutorialss and thing I read wehn I was learning html, I didnt even realize that </p> was a legitimate tag.. I learned something new today.

But we might be ble to help more if you posted the code thats giving you trouble.
I'm correcting you, you're wrong. If you're coding in old messy html you can leave tags open like that. However, if you want to make everything w3c valid you need to close EVERY tag.



If you don't want to use CSS italic text you should know that the <i> tag is no longer valid. use <em></em> instead.
__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
collyer_1 is offline
Reply With Quote
View Public Profile Visit collyer_1's homepage!
 
Old 03-27-2006, 02:41 PM Re: Italics causes div to misbehave?
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Here is an example

Invalid code
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-27-2006, 09:28 PM Re: Italics causes div to misbehave?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
That worked. Great example.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-28-2006, 08:22 AM Re: Italics causes div to misbehave?
wyrde's Avatar
Novice Talker

Posts: 5
Trades: 0
Ahhhh, so I should be using the <em></em> tag for proper xhtml? The funny thing is, the <i></i> tag works great... if it isn't the entire paragraph.

One of the great things about life is that I learn something new every day!

Thanks Chip!
wyrde is offline
Reply With Quote
View Public Profile
 
Old 03-28-2006, 11:12 AM Re: Italics causes div to misbehave?
Extreme Talker

Posts: 170
Location: Canada
Trades: 0
Yes, the <i></i> tag works, but is not valid XHTML.
__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
collyer_1 is offline
Reply With Quote
View Public Profile Visit collyer_1's homepage!
 
Old 03-28-2006, 01:27 PM Re: Italics causes div to misbehave?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The <i> tag is perfectly valid in XHTML
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-28-2006, 01:46 PM Re: Italics causes div to misbehave?
Extreme Talker

Posts: 170
Location: Canada
Trades: 0
I stand corrected. I checked the W3c validator, and it let the <i> tag slide. I was taught that it was being replaced by the <em> tag (guess my teachers wrong). I'll do some more research on the <em> tag.

Upon further study I have discovered why I was told to use <em> as opposed to <i>. <i> is visual only, it just makes your text italic. <em> however declares Emphasis upon a certain block of text. SO in the event that the visaully impared are viewing your page, the <strong> and <em> tags should be used instead of <b> and <i>. The visual effect would be the same, but it would be spoken differently.
__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE

Last edited by collyer_1; 03-28-2006 at 02:00 PM..
collyer_1 is offline
Reply With Quote
View Public Profile Visit collyer_1's homepage!
 
Old 03-28-2006, 02:57 PM Re: Italics causes div to misbehave?
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
<i> is a visual element. It makes the look of the text different (i.e., look like italicized text.)

<em> is a structural element. When we use <em> it is putting emphasis on the words inside the tag.

Both are valid, however <em> provides the structural element. That is why <em> should be used for accessibility compliance and <i> should not.

It is equivalent to using font to increase the size of the text at the top of the page. It makes it bigger but doesn't provide the structural element of <h1> .
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-28-2006, 06:58 PM Re: Italics causes div to misbehave?
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
If I'm not mistaken <i> and <b> will be going away at some point in the future. At least that's the impression I've been under for awhile now. I use <em> and <strong> in their place. With the latter tags browsers are free to present the text inside however they want, but as far as I know all will italicize <em> and make bold <strong>.

And with xhtml it is necessary to close all of your tags. Even tags like <br> that don't have a normal corresponding closing tag should be written as <br />.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Italics causes div to misbehave?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 2.74903 seconds with 12 queries