0

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
  • 3
    Wrap the text you want to capitalise in a <span> element.
    – user1864610
    Commented Jul 5, 2013 at 10:39
  • try considering the answers :) Commented Jul 5, 2013 at 21:05

2 Answers 2

7

Try display: inline;:

HTML:

<p>Hello</p>
<p>MARK</p>

CSS:

p { display: inline; }

Fiddle.

display:inline means that the element is displayed inline, inside the current block on the same line.

2

HTML:

<p>Hello <span class="capitalize">Mark</span></p>

CSS:

.capitalize {
    text-transform: uppercase;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.