SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 28
-
Oct 18, 2006, 14:11 #1
- Join Date
- Oct 2006
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can em and strong be used in other things than sentences?
Can em and strong be used in other things than in sentences? Like in lonely words in tables and so.
Thank much!
-
Oct 18, 2006, 14:22 #2
- Join Date
- Sep 2005
- Location
- North Texas
- Posts
- 137
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Should be able to apply these attributes to text content just about any place.
-
Oct 18, 2006, 14:40 #3
Honestly, they're just another inline element - so long as you don't use them to wrap block levels, you can pretty much use them where you like - JUST be wary of using extra tags when you could just style the parent container.
-
Oct 18, 2006, 15:47 #4
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
lonely words in tables and so? perhaps I or B would be a better choice
how appropriate is emphasis or strong emphasis if the word is all by its widdle self?
-
Oct 18, 2006, 15:54 #5
- Join Date
- Oct 2006
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by r937
what means you?--Za 71 sekund hotovo!
-
Oct 18, 2006, 16:07 #6
- Join Date
- Oct 2005
- Location
- Brisbane, QLD
- Posts
- 4,067
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What he means is that em and strong are s'posed to indicate different types of emphasis on certain words when reading a sentence. They're not s'posed to be used to make things bold or italic. If you're just using them to affect their presentation, you're better using a span and styling it with CSS.
-
Oct 18, 2006, 16:16 #7
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
Originally Posted by Tyssen
SPAN is such a wussy tag
-
Oct 18, 2006, 16:25 #8
- Join Date
- Oct 2005
- Location
- Brisbane, QLD
- Posts
- 4,067
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Using i or b to make words italic or bold is still using HTML for presentation which is the point I was making. I can't really think of a good example for using b but i could be used instead of em when marking up words that are s'posed to be italicised but not necessarily for emphasis, e.g. latin terms or titles of books, ships etc.
-
Oct 18, 2006, 16:43 #9
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
actually, latin words and book titles should be marked up with CITE
-
Oct 18, 2006, 16:47 #10
- Join Date
- Oct 2005
- Location
- Brisbane, QLD
- Posts
- 4,067
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Not necessarily. Cite is used for citations and references. A book title can be used in a sentence without it being a reference, e.g.: "I read The Lord of the Rings yesterday." Latin terms also do not necessarily have to be citations, for instance in medical texts when referring to bacteria.
-
Oct 18, 2006, 22:41 #11
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
As long as you mean to emphasise a word or a phrase, EM (or possibly STRONG) is the right element type. It doesn't matter if it's a 'lone word in a table' or if it's within a paragraph of text.
@Rudy: Latin words in general should not be marked up with CITE, unless they constitute the title of a work that you are citing or quoting from. The same applies to book titles. CITE is for citations: references to sources that you have quoted or otherwise drawn from.Birnam wood is come to Dunsinane
-
Oct 19, 2006, 01:30 #12
- Join Date
- Dec 2004
- Location
- Derbyshire - UK
- Posts
- 2,651
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Why would you use <i> or <b> for anything? Aren't these tags deprecated now?
This would be using HTML for presentational purposes so unless this should be <strong> or <em> used in it's proper semantical sense then surely you should be apply any bold or italic through the use of css?
-
Oct 19, 2006, 02:54 #13
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No, I and B are not deprecated. They can be used when you want to adhere to certain typographic conventions (like italicising ship names or phrases in foreign languages).
I and B should not be used for emphasis, though. That's what EM and STRONG are for. Most of the time you should use CSS to make things italic or boldfaced, but there are certain things that are italicised (and probably boldfaced, too, although I can't come up with any) by tradition.
A couple of examples:
HTML Code:<p><i>Titanic</i> sank on its maiden voyage in 1912.</p> <p>Semantics is my <i lang="fr">raison d'être</i>.</p>
Birnam wood is come to Dunsinane
-
Oct 19, 2006, 09:54 #14
- Join Date
- Aug 2006
- Location
- Victoria, B.C. Canada
- Posts
- 592
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tyssen
Ed Seedhouse
-
Oct 19, 2006, 10:00 #15
- Join Date
- Dec 2004
- Location
- Derbyshire - UK
- Posts
- 2,651
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Wouldn't <strong> represent bold and <em> represent italic though if that's how it appeared in the original text?
Personally I avoid <b> and <i> now and if I need something bold or italic purely for presentational and visual purposes then I'll use CSS to achieve this.
-
Oct 19, 2006, 10:31 #16
- Join Date
- Jul 2002
- Location
- Ottawa, Canada
- Posts
- 1,766
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by csswiz
When you're writing something like raison d'etre or Lord of the Flies, you're not actually emphasizing those words. They're not actually more important than the other words, but we use <i> to follow the typographical convention of italicising certain words.
Consider the following sentence:
We were extremely pleased with their translation of La Peste.
In this case, the word "extremely" should be marked up with the <em>, since it's actually emphasized in the sentence. "La Peste" is the name of a novel, so it is marked up with <i>. Speaking aloud, you would change your tone when saying "extremely" but not when saying "La Peste".
It doesn't actually matter whether you use <i> or CSS to style something in italics alone (without emphasis) -- both are presentational, and you need some extra HTML to do it either way (such as a <span>).
-
Oct 19, 2006, 10:48 #17
Originally Posted by fatnewt
HTML Code:<p>When you're writing something like <span lang="fr">raison d'etre</span> or ...</p>
Code:span:lang(fr) { font-style: italic; }
-
Oct 19, 2006, 11:18 #18
- Join Date
- Aug 2006
- Location
- Victoria, B.C. Canada
- Posts
- 592
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by csswiz
Ed Seedhouse
-
Oct 19, 2006, 22:46 #19
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by csswiz
Using STRONG/EM for bold/italics is every bit as bad as using B/I for emphasis.
Originally Posted by csswiz
HTML Code:<span class="foreign" lang="fr">je ne sais quoi</span>
Code:.foreign {font-style:italic}
HTML Code:<i lang="fr">je ne sais quoi</i>
Birnam wood is come to Dunsinane
-
Oct 20, 2006, 01:43 #20
- Join Date
- Dec 2004
- Location
- Derbyshire - UK
- Posts
- 2,651
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for clearing that up. I suppose it's in my mind set that anything that applies anything presentational in the code is bad but that obviously isn't the case.
It's probably come into my way of thinking from the days when <font color=red><i></i></font> was acceptable.
Like you say though Tommy it does make much more sense than to simply have an <i> in the page itself than to try and achieve this through CSS so thanks for correcting the error of my ways
-
Oct 20, 2006, 02:02 #21
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's a question of somehow highlighting text without necessarily emphasise it. Using CSS is usually the way to go, but for some cases I think it's just as good – or better – to use <i> or <b>. That way you'll achieve the purpose of highlighting even in non-CSS browsers, like Lynx.
My recommendation is: don't be afraid of <i>, but think twice about it before you use it.Birnam wood is come to Dunsinane
-
Oct 20, 2006, 02:08 #22
- Join Date
- Dec 2004
- Location
- Derbyshire - UK
- Posts
- 2,651
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yeah it's a tricky one of when to use it as obviously using <i> or <b> is adding something visual which does allow for non-css browsers to see it but then where does this stand with screenreaders?
If you are using the <b> tag, aren't you essentially emphasizing the word visually to a user and therefore wouldn't <strong> be a better use so that a visually blind user would also get the same experience?
Sorry, I hope this doesn't come across as argumentative... it's just something that I'd like to get my head around as English never was one of my strong points at school
-
Oct 20, 2006, 05:48 #23
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by csswiz
Originally Posted by csswiz
But if you just want to make a ship's name italic (because that's been tradition for centuries), use I. You wouldn't emphasise the ship's name particularly when reading the text out loud. It's just a convention to use italics for ships' names.
Originally Posted by csswiz
Birnam wood is come to Dunsinane
-
Oct 20, 2006, 06:45 #24
- Join Date
- Sep 2006
- Location
- Nottingham, UK
- Posts
- 3,133
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I always thought B and I were deprecated as well - learn something new every day i guess!
On the orignal topic though - if this person has lone words in a table to style, wouldnt he be better off just using css on the table cell? No extra markup, no worrying about if you are using the right tag...
-
Oct 20, 2006, 12:26 #25
- Join Date
- Jul 2002
- Location
- Ottawa, Canada
- Posts
- 1,766
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I would generally recommend having the CSS:
Code:td { font-weight: bold; }
Code:<td><b>Text</b></td>
Bookmarks