Ich versuche, einen vertikalen linken Rand über mehrere Elemente zu erstellen, und ich habe versucht, ein paar der am besten bewerteten Vorschläge aus this thread, aber ohne Erfolg.CSS: Grenze nicht richtig angezeigt
Derzeit sieht die Grenze wie folgt aus:
(ja, es ist so pathetisch schwarze Linie)
Natürlich, was ich will ist eigentlich für die Linie, die die gesamte linke aufzunehmen Seite der Seite. Alle Ratschläge werden sehr geschätzt!
Meine ERB-Datei:
<h1 class="p1_vs_p2"><%= @game.player.name %> vs <%[email protected] %></h2>
<h2 class="player_chose"> You chose <%= @game.player.weapon.capitalize %></h2>
<h2 class="computer_chose"><%= @game.computer.name %> chose <%[email protected] %></h2>
<div style="clear: both;"></div>
<% if @game.outcome == Game::POSSIBLE_OUTCOMES[0] %>
<h2 class="victory_message"> Congratulations, you win!</h2>
<% elsif @game.outcome == Game::POSSIBLE_OUTCOMES[1] %>
<h2 class="tie_message"> It's a tie!</h2>
<% else %>
<h2 class="defeat_message">You lost this time.</h2>
<% end %>
<h4> <a href="/" class="play_again">Play Again</a> </h4>
<div class="vertical_line">
Meine CSS-Datei:
html {
height: 100%
}
body {
background-color: #f4f1ec;
}
input[type="radio"]{
margin: 0 5px 0 10px;
}
table.center {
margin-left:auto;
margin-right:auto;
}
.title {
padding-top: 40px;
text-align: center;
font-family: 'Raleway', sans-serif;
color: #6495ED;
padding-bottom: 100px;
}
.input_name_button {
position: fixed;
text-align: center;
top: 50%;
left: 50%;
margin-top: -50px;
margin-left: -100px;
}
.play_button {
text-align: center;
padding-top: 30px;
}
.p1_vs_p2 {
padding-top: 40px;
text-align: center;
font-family: 'Raleway', sans-serif;
color: #B0C4DE;
padding-bottom: 100px;
}
.player_chose {
color: #6495ED;
float: left;
padding-left: 200px;
}
.computer_chose {
color: #FFA07A;
float: right;
padding-right: 50px;
}
.victory_message {
color: #8FBC8F;
text-align: center;
bottom: 0px;
width: 100%;
padding-bottom: 300px;
position: fixed;
}
.tie_message {
color: #FFDEAD;
text-align: center;
bottom: 0px;
width: 100%;
padding-bottom: 300px;
position: fixed;
}
.defeat_message {
color: #F08080;
text-align: center;
bottom: 0px;
width: 100%;
padding-bottom: 300px;
position: fixed;
}
a.play_again {
color: #A9A9A9;
text-align: center;
bottom: 0px;
width: 100%;
padding-bottom: 100px;
position: fixed;
font-family: 'Raleway', sans-serif;
text-decoration: none;
}
.vertical_line {
width: 4px;
background-color: black;
height: 100%;
float: left;
}
Lassen Sie mich wissen, wenn Sie etwas anderes und ich werde glücklich sein, es zu schaffen. Vielen Dank. :)
ich gerade versucht, alle Inhalte für die Seite in einem div Einwickeln und angewandt, um den Styling Sie zur Verfügung gestellt, aber es hat nur eine leicht größer blac k Zeile erscheint stattdessen am oberen Rand der Seite? Ich bin ein bisschen noob, wenn es um CSS geht haha, also vergib mir! Oh, und danke für die Antwort! – IainK
Ich musste nur dir helfen .. Ich habe es auf W3shools versucht und es hat gut funktioniert: P –