PHPLover
PHPLover

Reputation: 12957

How to make one string from a sentence capital in HTML/CSS?

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.

Upvotes: 0

Views: 151

Answers (2)

Ellis
Ellis

Reputation: 328

HTML:

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

CSS:

.capitalize {
    text-transform: uppercase;
}

Upvotes: 2

Mohammad Areeb Siddiqui
Mohammad Areeb Siddiqui

Reputation: 10179

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.

Upvotes: 7

Related Questions