2 replies [Last post]
Qlubbie
Qlubbie's picture
Offline
newbie
Last seen: 7 years 13 weeks ago
Timezone: GMT+1
Joined: 2007-01-04
Posts: 4
Points: 3

Hello,

Question:
i have an icon in a button element and i want the icon to have some margin/padding on the left.

how do i address this element in css?
<button type="button" class="btn btn-red">red<i class="button-icon-right fa fa-power-off"></i></button>

i thought it would be:
.i button-icon-right fa {

i also tried
i .button-icon-right fa {

but the element never changes...

can anyone help me out?

//mod edit: bbcode added ~gt

Qlubbie
Qlubbie's picture
Offline
newbie
Last seen: 7 years 13 weeks ago
Timezone: GMT+1
Joined: 2007-01-04
Posts: 4
Points: 3

the html element was: <button

the html element was:

<button type="button" class="btn btn-red">red<i class="button-icon-right fa fa-power-off"></i></button>

(i couldnt find a way to edit my post Smile)

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 2 years 13 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

"i" is an element, not a

"i" is an element, not a class, so ".i" is wrong.

"fa" is not an element, so the css syntax is wrong. Further, it is not descended from ".button-icon-right"

Try this,

i.button-icon-right {...}

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.