← HTML + CSS

Margem num fundo

Lida 1628 vezes

Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Boa noite.

Tenho uma Div, de fundo amarelo e adicionei-lhe uma imagem para fundo, mas é uma imagem pequena (icon), no repeat, fica do lado esquerdo e apenas 1 vez.

Mas o icon fica encostado à borda, não dá para lhe dar um empurrãozinho para a direita?

Margin não funciona :S

Obrigado :)
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Já tentaste padding?
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Já.

Mas aplicando um padding normal ele apenas mexe o conteúdo e não o fundo :S


EDIT: Lembrei-me de uma coisa básica: adiciono 2px sem fundo à imagem e está resolvido :P
Offline

Pedro Lopes 
Beta tester
Mensagens 3568 Gostos 18
Feedback +6

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

background: url('imagem.png') no-repeat top left 5px 5px;

O primeiro 5 é a distancia em x e a segunda é em y.