manu p
manu p

Reputation: 985

Increase size of Icon in HTML

Is there a way to increase the size of icon below.I tried with size attribute but not working

<span style="color:red">&#x1F6C8</span>

Upvotes: 0

Views: 5454

Answers (4)

KreutzerCode
KreutzerCode

Reputation: 392

The best way to achieve this is to nest a span like this:

<span style="color:red">sdsd <span style="font-size:36px">&#x1F6C8</span></span>

Nesting spans is valid, see this question:

Can you have a <span> within a <span>?

Upvotes: 0

Tom
Tom

Reputation: 5677

If you only want to increase the size of the icon then you can wrap it in another span element and set a bigger font-size for this element only :

.icon {
  font-size: 30px;
}
<span style="color:red">sdsd <span class="icon">&#x1F6C8;</span></span>

Upvotes: 0

Raptor
Raptor

Reputation: 54212

well, as mentioned in comment, it's actually a text, therefore you can use CSS font-size attribute to increase the size of icon. Also, you missed a ;.

<span style="color:red; font-size: 80px">&#x1F6C8;</span>

Upvotes: 2

M&#242;e
M&#242;e

Reputation: 294

I think font-size will work, try put it in style

Upvotes: 0

Related Questions