2010-12-14 3 views
0

다른 장소에 하이퍼 링크를 넣으려고합니다. google.com 링크를 페이지의 다른 위치로 이동하려면 어떻게해야합니까?하이퍼 링크를 다른 장소에두고 싶습니다.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
     "http://www.w3.org/TR/html4/loose.dtd"> 

<html> 
<head> 
<title>Randy's first html web page !</title> 
<style type="text/css"> 
body 
{background-image:url('Koala.gif');} 
h1 
{ 
text-align:center; 
font-size:500%; 
} 
h2 
{ 
text-align:center; 
font-size:250%; 
} 
p 
{ 
text-align:center; 
font-size:200%; 
color:#00fff0; 
} 
div 
{ 
background-color:#efffff; 
} 
a 
{ 
text-align:center; 
} 
th 
{ 
background-color:green; 
} 
tr 
{ 
background-color:green; 
} 
table 
{ 
width: 200px; 
margin-left: auto; 
margin-right: auto; 
} 
</style> 
</head> 
<h1> Hello Professor</h1> 
<h2> By: Randy White</h2> 
<P> It's getting better as the term goes on.</P> 
<P>Week 2</P> 
<P><img src="Hydrangeas.jpg" width="150" height="100" alt="Hydrangeas.jpg"></P> 
<table border="1"> 
<tr> 
<th>Month</th> 
<th>Day</th> 
<th>Year</th> 
</tr> 
<tr> 
<td>December</td> 
<td>13</td> 
<td>2010</td> 
</tr> 
</table> 
<a href="http://www.google.com">Visit Google!</a> 
</body> 
</html> 
+1

: CTRL-X, CTRL-V – miku

+0

내가 CSS를 새로운 오전 및 문서의 다른 곳에서/붙여 넣기를 절단함으로써 – user770022

+0

내가 더 잘 얻고 있지만 여전히 몇 가지 문제가없는 농담? – David

답변

0

를이 추가 :

#google-link { 
    text-align: center; 
} 

이 중앙에 내부 텍스트를 정렬합니다. 당신의 HTML에서

이에 구글 링크를 변경합니다

<div id="google-link"><a href="http://www.google.com">Visit Google!</a></div> 

사업부는 그것을 위의 스타일을 가져옵니다 구글 링크 ID, 태그입니다. 스타일은 실제로 div의 내용에 영향을 미치고 div의 내용을 중앙에 맞 춥니 다. div 자체는 페이지의 너비입니다.

+0

That 's got – user770022

+1

@randy : 운이 좋다면 아무 것도 작동합니다. 너는 오프닝을 놓치고있어 태그 – Gerrat

+0

너는 그걸 보 겠니? 좋은 캐치, @Gerrat - 나는 그것을 완전히 보았다. –

0
body { 
    margin: auto; 
} 
0
  1. 귀하의 html에는 < body> 태그가 없습니다.
  2. "text-align : center;"를 추가하십시오. body 태그에 대한 귀하의 CSS에.
한마디로
관련 문제