2010-04-30 4 views
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<style type="text/css"> 
#action-icons 
{ 
    float:right; 
} 
#action-icons.img 
{ 
    position:relative; 
    top:-30px; 
    padding-right:200px; 
} 
</style> 
</head> 

<body> 
    <h1 class="edit">Some nifty title 
    <span id="action-icons"> 
    <img src="foo.png" width="64" height="64" alt="" id="newsticky"/> 
    <img src="bar.png" width="60" height="60" alt="" id="trash"/> 
    </span> 
    </h1> 
</body> 
</html> 

답변

2

시도를하지 않습니다.

편집 :#action-icons.img 당신은 #action-icons img이므로 점을 제거하십시오.

<img src="bar.png" width="60" height="60" alt="" id="trash" class="img"/> 

는 희망이 도움이 : 당신이 그것을 가지고 같이 HTML의 모습 있도록

도트는 클래스로 img을 설정합니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<style type="text/css"> 
#action-icons 
{ 
    float:right; 
} 
#action-icons img 
{ 
    position:relative; 
    top:-30px; 
    margin-left:50px; 
} 
</style> 
</head> 

<body> 
    <h1 class="edit">Some nifty title 
    <span id="action-icons"> 
    <img src="foo.png" width="64" height="64" alt="" id="newsticky"/> 
    <img src="bar.png" width="60" height="60" alt="" id="trash"/> 
    </span> 
    </h1> 
</body> 
</html> 
+0

그것은 작동하지 않습니다. – ripper234

+0

고마워, 지금은 :) – ripper234

+0

ㅎ, 인라인이 필요 없다는 것이 밝혀졌다. 문제는 바로 나의 선택기였다. – ripper234

2

margin-right

을 시도하고 이미지를 해결하기 위해

#action-icons img 

사용 -

편집 여기에 전체 작업 코드입니다.

#action-icons.img 

"는 ID action-icons클래스 img있는 모든 요소를 ​​의미한다.

+0

그것은 작동하지 않습니다. – ripper234

+1

@ripper 추가적으로'# action-icons.img' 대신'img # action-icons'를 사용하십시오. 그대로, 규칙이 적용되지 않습니다. –

+0

나는 복사하지 않았다! :) – Kyle

2

변경

#action-icons.img 

#action-icons img 

사람 및

을 확인

그것은 나를 위해 파이어 폭스에서 작동