我正在學校項目的HTML文件。我可以使用一些幫助來對齊我的網頁上的文字。我試過顯示標籤,例如內聯塊,但似乎沒有任何工作。附上的圖片是我想要發生的事情 這就是我在做內聯塊時發生的情況。 請謝謝!學校項目的文本對齊
0
A
回答
1
你必須改變你的HTML代碼結構類似這樣的....
body > h1
body > section.a > h2 > ol
body > section.b > h2 > ol
現在在CSS,你需要做的像一些變化......
section.a, section.b {
width:49%;
}
section.a{
float:left;
}
section.b{
float:right;
}
body {
/*background: url("DC.jpg") no-repeat top right;
background-color: silver;
background: url(MarvelDC.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
*/
background:#000;
}
h1 {
font-family: sans-serif;
font-size: 40;
text-align: center;
margin-top: auto;
color: white;
}
h2, h3 {
font-family: serif;
font-size: 30;
color: white;
}
section.b {
vertical-align: text-top;
}
section.a{
float:left;
width:49%;
}
section.b {
float:right;
width:49%;
}
ol.a, ol.b {
color: white;
}
<h1>Best Marvel and DC TV Shows</h1>
<section class="a">
<h2>Descriptions and Pictures</h2>
<ol class="a">
<li><a href="C:\Users\Nick\Documents\ECS\HTML\arrow.html">Arrow on CW: 5 Seasons, 2012-present</a></li>
<li><a href="C:\Users\Nick\Documents\ECS\HTML\daredevil.html">Daredevil on Netflix: 2 seasons, 2015-present</a></li>
<li><a href="C:\Users\Nick\Documents\ECS\HTML\agents of shield.html">Agents of SHIELD on ABC: 4 seasons, 2013-present</a></li>
<li><a href="C:\Users\Nick\Documents\ECS\HTML\the flash.html">The Flash on CW: 3 seasons, 2014-present</a></li>
<li><a href="C:\Users\Nick\Documents\ECS\HTML\legends of tomorrow.html">Legends of Tomorrow on CW: 2 seasons, Jan 2016-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/Jessica_Jones_(TV_series)">Jessica Jones on Netflix: 1 season, 2015-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/List_of_Supergirl_episodes">Supergirl on CW: 2 seasons, 2015-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/Luke_Cage_(TV_series)">Luke Cage on Netflix: 1 season, 2016</a></li>
</ol>
</section>
<section class="b">
<h2>List of Episodes (Wiki)</h2>
<ol class="b">
<li><a href="https://en.wikipedia.org/wiki/List_of_Arrow_episodes">Arrow on CW: 5 Seasons, 2012-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/Daredevil_(TV_series)">Daredevil on Netflix: 2 seasons, 2015-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/List_of_Agents_of_S.H.I.E.L.D._episodes">Agents of SHIELD on ABC: 4 seasons, 2013-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/List_of_The_Flash_episodes">The Flash on CW: 3 seasons, 2014-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/Legends_of_Tomorrow">Legends of Tomorrow on CW: 2 seasons, Jan 2016-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/Jessica_Jones_(TV_series)">Jessica Jones on Netflix: 1 season, 2015-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/List_of_Supergirl_episodes">Supergirl on CW: 2 seasons, 2015-present</a></li>
<li><a href="https://en.wikipedia.org/wiki/Luke_Cage_(TV_series)">Luke Cage on Netflix: 1 season, 2016</a></li>
</ol>
</section>
+0
好的,謝謝! – Flashpoint
0
試試這個:
body{position:relative;}
section.b{position:absolute;top:0px;right:0px;}
之後,您可以更改對上section.b的頂部&值,以得到它正確對齊。
+0
好的非常感謝!愛這個名字btw – Flashpoint
+0
Pl upvote並接受答案,如果這有幫助! – Deadpool
相關問題
- 1. C++學校項目
- 2. 學校項目的版本控制?
- 3. 學校項目的版本控制
- 4. HTML和CSS學校項目
- 5. 初學者:對齊文本
- 6. 的Android NaviagtionDrawer項目文本對齊
- 7. JTextFields和我的學校項目
- 8. 使學校項目開源的問題?
- 9. 基於PHP/jQuery的學校項目
- 10. Java的學校項目隨機誤差
- 11. 小型VB.net學校項目與陣列
- 12. C#基礎學校項目SOS
- 13. 學校項目分段錯誤
- 14. 致命異常:主(學校項目)
- 15. MySQL學校項目 - 加入問題
- 16. JAVA NullPointerException異常錯誤(學校項目)
- 17. jquery - javascript - 美術學校項目
- 18. 劍道UI專業爲學校項目
- 19. 需要針對學校項目的Android Studio/OSMDroid指南
- 20. 對我們學校項目的建議android應用程序
- 21. 數學ShowLegend怪異文本對齊
- 22. 數學乳膠水平文本對齊
- 23. NavigationView項文本對齊
- 24. QListWidget對齊項目
- 25. 對齊HTML項目
- 26. CheckBoxList項目對齊
- 27. 學校管理系統初學者python項目?
- 28. 使用Vesta CP在學校網站上託管學生項目
- 29. 初學者C++問題(學校項目調試問題)
- 30. 文本對齊不對齊
你能提供你的網頁html嗎? – Jacopo
是的,這裏是CSS https://drive.google.com/file/d/0B-oE76PfeDagZ1preHpRRjBuRkE/view?usp=sharing,這裏是HTML https://drive.google.com/file/d/0B-oE76PfeDagM3BLUmhEVThDWk0/view?usp = sharing – Flashpoint