Question:
How can i use bold, italic & underline tags in HTML, all three tags at the same time?
DDeshmuk
2010-02-18 11:44:18 UTC
How can i use bold, italic & underline tags in HTML, all three tags in one line or in one paragraph ?

Can i have an example of this ?
Output should be bold, italic & underline at the same time .

thanks
Five answers:
Nehpets
2010-02-18 12:11:47 UTC
There are several ways in which you can do this. You can nest the text you want to have bold, italic, and underlined in the various HTML tags that do this.



Ex: TEXT

OR: TEXT



Also, you could place the text in a span, div, or p tag and use a style attribute. This is applying an in line style using CSS, which is closer to web standard. Here is an example using a p (paragraph) tag.



TEXT





If you wanted to use a span or div tag instead you would simply replace the p with the desired tag. The biggest difference is that a DIV tag is a DIVision of your site, it will span the entire width of the parent element unless you specify a width. The above example would take everything inside the p tag and apply the bold, italic and underline to it. Say you have some text in a p tag but only want a few words to be bold, italic and underlined. You would span the desired words and use the same style attribute like this



These words are normal while these words have bold, italic, and underlined





CSS is the current web standard and is very powerful, but can be a bit of a pain to start off in. If you've already got a good working knowledge of (X)HTML here is a good place to start looking into the world of CSS: http://www.w3schools.com/css/default.asp



If your just starting out with (X)HTML in general I'd suggest you get a good understanding of that before you begin learning CSS if that's what you wanted to do. Here is a good spot to start out on HTML: http://w3schools.com/html/default.asp
Leo D
2010-02-18 12:03:30 UTC
Bold is completely presentational. Italics is almost always presentational, unless you're using a transitional doctype and naming a ship of some sort. And underlining anything that isn't a link (or a submit button dressed up as a link) should be avoided completely because it can get confusing between a link and a non-link.



Making bold and italicising the first line and every paragraph can be done in CSS as so:

p, :first-line {

    font-style: italic;

    font-weight: bolder;

}



Nesting can be done by simply making sure that you close all elements and inner elements before outer elements, for example … is right, but is wrong because head isn't closed and HTML which is an outer element, closes before body, one of its inner elements.



Back to CSS, it sounds like you're a beginner, but presentational markup is a bad habit to get into and it could be hard to break. You should pick up a guide that will teach you how to write good accessible, structural and meaningful HTML from the very beginning. Please try http://htmldog.com/ Another really good website is http://www.w3schools.com/ Email me if you have any further questions.
anonymous
2016-04-12 07:35:04 UTC
It's pretty simple. All you have to do is to configure all these in CSS. I'll be as simple as I can. In your HTML:

Hi this is the sentence I want to design

here's what you do in CSS: #content p {font-weight: bold; font-style: italic; text-decoration: underline; } So that's it. You can copy and paste what I did and just change the name of div on CSS and HTML (the #content). :)
daniel
2015-03-30 19:41:38 UTC
hard task. research using google and yahoo. that will could actually help!
ifiossdaily
2010-02-18 11:53:56 UTC
just nest them together.



TEXT HERE


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...