2011-06-29 26 views
0

私はリリースされている映画のウェブサイトを設計していますが、すべてのブラウザのウィンドウサイズと画面サイズに合わせるためにいくつか問題があります。基本的には、スプラッシュページなどのマークアップには、ページの上部にフィルムのロゴがあり、その下にビデオ(映画の予告編)が表示され、ユーザーをホームページに誘導するための入力ボタンがあります。これらのすべては、すべてのブラウザーウィンドウのサイズに合わせる必要があります。しかし、私がさまざまなサイズなどを試してみると、コンテンツは中央に残っておらず、ビデオはその背景のイメージから移動します。どのように私はCSSでそれを修正するだろうか?流体CSSレイアウトの質問

他にもいくつかのページ、つまり概要、動画、プロジェクトに寄付するページがあります。私は、コンテンツをすべてのサイズで正しく動作させるように、同じ方法でこれらを動作させたいと思います。ありがとう!

これを見て、私が何を意味しているのかを知りたい場合は、リンクはhttp://rescuedthemovie.com/new/homeです。これはデベロッパーのページであり、最終的なデザインは基本的にはありませんので多少乱雑ですが、私が何を話しているのか見ることができます。

jwinton

+0

を調べて、私はちょうどスプラッシュページアップとランニングを得た方法です。 http://rescuedthemovie.com/new。そこの内容を確認してください。 – jwinton

答えて

0

:見てみましょう。これはすべてのブラウザで機能するはずであり、解像度にかかわらずすべてを中央に維持します。

#div { 
    margin:0 auto; 
    text-align:center; 
} 

私はなど、あなたが中心のdivの内側にあなたがそれらを配置したい場所をそれらを配置することができますこの方法をメインコンテンツのdivのためにこれを使用して、そのすべてが中央に配置され、その後、ビデオ用に別のdivを作成し、リンクを示唆しています。

0

私はあなたのデザインを理解していません。私は以下の問題を抱えています。

  • あなたはdiv id="container"を持っているが、それが含まれている唯一のものはdiv id="fotter"です。残りの要素はすべてコンテナdivの「外側」にあります。

  • div id="logo"のスタイルはmargin-top: 1%; margin-left: 25%;です。これはどのように中心化されますか?

  • div id="slider"にはposition: relative; left: 26%; top: 3em;があります。これは、左から26%、3emを元の位置の上からプッシュし、前に「ギャップ」を残していることを意味します。

  • h1margin: left; 300px;です。まさにあなたはそれが欲しいのですか?

  • h1にはaの要素があります。divの要素がありますか?これは、インライン要素内のブロックレベル要素のようなものです。全く間違っている。これらのすべてのa要素は、divの内側にあり、divの位置に配置する必要があります。

  • div#footerdiv#containerです。div#foooter div#containerませposition: relativeを持っていないながらposition: absolute のスタイルを持っています。この は2つのものを引き起こします。 div#container は、 のコンテンツを持たず、のコンテンツを持っているため、div#fotterは です。

  • あなたは3 div#recentです。 IDは一意でなければなりません。これは許可されていません。 calssesをインストールしてください。

私はこれについてどうやって行くのかについてスケルトンを与えます。

HTML

<!DOCTYPE html> 
<html lang="en"> 
<head> 
<meta charset="utf-8"> 
<title>Rescued: The Movie</title> 
<link rel="stylesheet" href="my_styles.css"> 
</head> 
<body> 

<div id="container"> 

<div id="logo"> 
<a href="http://rescuedthemovie.com"><img src="http://rescuedthemovie.com/new/images/logo.png" alt="Rescued Logo" /> </a> 
</div> 

<div id="nav"> 
<ul> 
<li><a href="http://rescuedthemovie.com/home.html">home</a></li> 
<li><a href="http://rescuedthemovie.com/synopsis.html">synpsis</a></li> 
<li><a href="http://rescuedthemovie.com/videos.html">videos</a></li> 
<li><a href="http://rescuedthemovie.com/blog.html">blog</a></li> 
<li><a href="http://rescuedthemovie.com/partner.html">partner</a></li> 
</ul> 
</div> 

<div id="slider"> 
<img src="http://rescuedthemovie.com/images/slides/slide1.jpg" alt="Slide 1" /> 
<img src="http://rescuedthemovie.com/images/slides/slide2.jpg" alt="slide 2" /> 
<img src="http://rescuedthemovie.com/images/slides/slide3.jpg" alt="slide 3" /> 
</div> 

<div id="blog"> 
<h1>NEWS</h1> 
<div class="recent"> 
<h2>The Putnam's Adoption Journey</h2> 
<a href="http://rescuedthemovie.com/blog">My husband and I thought our family was complete. We had our two children (one boy and one girl) and were completely satisfied with that. Life was comfortable. My youngest had just started Kindergarten so I found myself with more free time than I had had in nine years! I was enjoying the freedom of grocery shopping without toddlers. But then God started stirring something in our hearts...</a> 
</div> 
<div class="recent"> 
<h2>God's Divine Leading: Part 3</h2> 
<a href="http://rescuedthemovie.com/blog">I remember feeling a little surprised that she had decided on adoption. I guess I just assumed that she would opt to keep her baby. I have to admit that I did wonder for a fleeting moment if perhaps the Lord was trying to lead Jurgen and I to adopt her baby, but then reasoned that a domestic adoption might be too risky. People might also think it strange, since I was the one who encouraged her to consider adoption in the first place, rather than end her baby’s life...</a> 
</div> 
<div class="recent"> 
<h2>God's Divine Leading: Part 2</h2> 
<a href="http://rescuedthemovie.com/blog">When I awoke, I had an overwhelming desire to have a baby of our own. The dream was extraordinarily real and tangible, and I felt strongly that the Lord had given me this dream as an answer to my questions about pursuing adoption. I am not the type of person who normally bases my decisions on dreams, but this was different. It was as if the Lord Himself had dropped this desire into my heart...</a> 
</div> 
<a id="more" href="http://rescuedthemovie.com/blog">Read More</a> 

</div> 

<div id="footer"> 
<p>&copy;2011 Rescued</p> 
</div> 



</div> 

</body> 
</html> 

CSS

{ 
margin: 0; 
padding: 0; 
} 

img 
{ 
border: 0; 
} 

a 
{ 
text-decoration: none; 
color: #000; 
} 

body 
{ 
background: url("http://rescuedthemovie.com/new/css/../images/blog_bg.jpg") no-repeat scroll center top #000; 
} 

div#container 
{ 
width: 960px; 
margin: 20px auto; 
margin-bottom: 0; 
} 

div#logo 
{ 
width: 850px; 
height: 300px; 
margin: 0 auto; 
} 

div#logo a 
{ 
width: 100%; 
height: 100%; 
display: block; 
} 

div#nav 
{ 
background: url("http://rescuedthemovie.com/new/css/../images/nav.png") no-repeat scroll 0 0 transparent; 
font-size: 25px; 
text-transform: uppercase; 
} 

div#nav ul 
{ 
width: 900px; 
margin: 10px auto; 
} 

div#nav ul li 
{ 
display: inline-block; 
margin: 0 40px; 
color: #FFF; 
} 

div#nav ul li a 
{ 
color: #FFF; 
} 


div#slider 
{ 
width: 500px; 
height: 250px; 
margin: 0 auto; 
margin-top: 77px; 
float: right; 
position: relative; /*romove this in the final design*/ 
} 

div#slider img /*romove this in the final design*/ 
{ 
position: absolute; 
top: 0; 
left; 0; 
} 

div#blog 
{ 
float: left; 
width: 450px; 
color: #FFF; 
margin-bottom: 50px; 
} 

div#blog h1 
{ 
margin: 20px 0; 
} 

div#blog a#more 
{ 
float: right; 
color: red; 
} 

div.recent 
{ 
margin: 20px 0; 
border: 1px solid #555; 
padding: 5px; 
} 

div.recent h2 
{ 
font-weight: bold; 
color: #777; 
margin-bottom: 10px; 
} 

div.recent a 
{ 
color: #FFF; 

} 

div#footer 
{ 
clear: both; 
color: #FFF; 
text-align: center; 
font: 25px; 
margin: 20px auto; 
} 

div#footer p 
{ 
font-size: 25px; 
} 

このoffcouseは、固定幅のレイアウトです。しかし、あなたは簡単にそれを流体やエスタリックに変えることができます。これは、

Layout

+0

@jwinton:あなたはサイトを変更し続けます。ナビは新しいものです。とにかく私はそれを加えました。 – Jawad

+0

@jwinton:あたかもあなたのために働いたかのように戻ってきます。 – Jawad