+ 3

Can we use two or more attribute in one tag? ex= <p align="center" border="2" > Plz reply </p>

13th Mar 2017, 6:13 AM
Neeraj Chauhan
Neeraj Chauhan - avatar
6 Answers
+ 10
you can use all supported attributes at once in a single tag. but remember that it's better to style tags with css ;)
13th Mar 2017, 6:44 AM
Mario L.
Mario L. - avatar
+ 3
Yes, you can, but I'd suggest using the style tags, even if they are just inline style tags. In HTML5, it's always better to keep the styling separate from the text/elements of the page. So, with the style tags, your code will be like this: <p style="text-align:center; border: 2px solid black;> Plz reply

This will create a solid black border of a width of 2 pixels around your paragraph, where the text is centered.
13th Mar 2017, 10:12 AM
Aarthi Sri
+ 2
Simple as Mario said, yes you can use more then one attribute inside a TAG so in your example. p - this is the TAG text-align="center" this is a attribute But as Mario pointed out its more efficient to use css in two ways. INLINE CSS <p style="text-align:center; border: 2px">Some Text

External CSS (Written in a .css file and gotten in the header) the content of mystyle.css would then be .p { text-align: center; border: 2px; }
13th Mar 2017, 7:42 AM
Simen Daehlin
Simen Daehlin - avatar
+ 1
Yes, but as was mentioned. You want to keep styling separate from the structure of a page.
19th Mar 2017, 9:00 AM
Jim Tryon
Jim Tryon - avatar
0
You can but I wouldn't advise it. Is there a specific project or problem this trying too solve or is this just a knowledge base question?
13th Mar 2017, 11:40 PM
Omar Themightiestdisciple Clifton
Omar Themightiestdisciple Clifton - avatar
0
it's possible but like Jim said always keep styles on a separate file
28th Mar 2017, 12:46 AM
Nara Victor
Nara Victor - avatar