I want to print Hello MARK
in HTML. If I'm going to assign different styles to both the string using <p>
tag then the text 'MARK' is coming on next line. I want to show as Hello MARK
. So what could be the solution for this issue? Thnaks in Advance.
2 Answers
Try display: inline;
:
HTML:
<p>Hello</p>
<p>MARK</p>
CSS:
p { display: inline; }
display:inline
means that the element is displayed inline, inside the current block on the same line.
HTML:
<p>Hello <span class="capitalize">Mark</span></p>
CSS:
.capitalize {
text-transform: uppercase;
}
<span>
element.