2 divided flex overflow
<style>
ul.t {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
border: 1px solid #555;
}
li a.t {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li.t { text-align: center;
border-bottom: 1px solid #555;
}
li.t:last-child {
border-bottom: none;
}
li a.ta {
background-color: #4CAF50;
color: white;
}
li a.t:hover:not(.ta) {
background-color: #555;
color: white;
}
</style>
<div style="box-sizing: border-box;display: flex; max-height: 500px; position: relative; overflow-y: auto;">
<div style="width:30%; position: fixed; top:50px;right:20px; height: 100%; overflow: auto;">
<ul class="t" style="margin-left: 20px;">
<li class="t"><a class="t ta" href="#top">Top</a></li>classを2つ
<li class="t"><a class="t" href="#somewhere1">Locate1</a></li>
<li class="t"><a class="t" href="#somewhere2">Locate2</a></li>
<li class="t"><a class="t" href="#somewhere3">Locate3</a></li>
</ul>
<div style="width:70%;"><pre style="border-left: 4px solid lightgreen; background-color: lightgrey; overflow-x: auto;">
<style>
ul.t {
list-style-type: none;
margin: 0;
~~~~~~~
overflow testing
listをoverflow: sticky; top: 220px; などとするとスクロールバーの限度がなくなってしまう。max-height: 500pxなども効かない。が全体の<div>でのmax-heightは効いたのと、一応、listを左右どちらかでposition:sticky; としたかったので、ここまでで良しとしておく。
出来れば左の高さだけに止めておきたいが。
Horizantal nav display: inline/float:left/right;
fixed position nav bar
Top fixed navibation bar ul { position: fixed; top: 0; width: 100%; }
Bottom fixed navigation bar ul { position: fixed; bottom: 0; width: 100%; }
text-shadow: horizantal/vertical/blur-radius/color; text-shadow play it.
white text with black shadow style="text-shadow: 3px 3px 5px #000000; " with <b>:big
then added, " 0 0 9px green, 0 0 10px red; " / it's colors are mixed
This paragraph
direction:rtl(right to left)/ltr(default: left to right)
; and text-shadow: 0 0 10px #FF0000; which gives text red neon glow shadow effect.
color 不可算名詞であり、具体的な例がある場合には可算名詞。上の場合は3つのcolorsがあり可算名詞。
a movie in color / warm colors / full color 24-bit color/ true colors/ similar colors同系色/fluorescent colors蛍光色 mixed colors
under color of... ...を言い訳にして
Border around text!
h2 { color: yellow; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; }
1px づつずらして枠を作るイメージか?
Border around text different one.
Multi color shadow
CSS box shadow
box-shadow: horizantal/ vertical/ blur/ /spread/ color
紙のカードやポラロイドカードのように見せるには、横horizantal 0 縦vertical に少し4~9辺りで2つ 異なるblurの値 rgba(0, 0, 0, 0.3) も異なる値を2つ 作ってやるとそれっぽく見える。
4つ目の値である spread を0以外にすると影がなくなってしまう。
23
Novenber 23
div.card { width:300px; box-shadow: 0 6px 8px 0 rgba(0, 0, 0, 0.3), 0 9px 15px 0 rgba(0, 0, 0, 0.2); text-align:center; } div.phead { background-color: #4CAF50; color:white; padding: 15px; font-size: 35px; } div.container1 { padding: 8px; } <div class="card" style="margin-left: 50px;"> <div class="phead"> <h2>23</h2>
clear: both; が必要
<img src="" alt"" style="width: 100%;">
とすれば上の<div class="phead"><h2>を置き換えられる。
Hoverable Dropdown
Tada! Hi!
dropdown の肝の部分→
.dropdown { position: relative; display: inline-block; } .dropdown-content { display:none; position: absolute; background-color: #f9f9f9; min-width: 160px; right: 0; box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.4); padding: 10px 12px; z-index: 1; } .dropdown:hover .dropdown-content { display: block; }
左のfloat margin-top: 150px;/margin-top:15%; などと設定すると拡大したときに右のfloat の枠外にズレる。
結局、div style="display: flex;" とmargin で調整
<img> hover/dropdown image
dropdown image width is set to 360px, also have to set dropdown's min-width 360px.


Dropdownに :hover したときにブロックが現れるように
display: block; 。
.drd:hover .drcontent { display: bllock; }
Dropdownに :hover したときだけに、contentが表示されるようにするには、content以下のブロックは display: none; で普段は表示を消しておく。z-index: 1; で最前面に表示を持ってくる。
.drcontent { display: none; position: absolute; background-color: cornsilk; min-width: 180px; box-shadow: 0 10 12 0 rgba(0, 0, 0, 0.5 ); z-index: 1; }
全体ではこうなる
ul.dr { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #444; } li.dr { display: inline-block; } li a, .dropbtn1 { display: inline-block; color: white; text-align: center; padding:12px 14px; text-decoration: none; } li a:hover, .drd:hover .dropbtn1 { background-color: crimson; } li.dropdown { display: inline-block; } .drcontent { display: none; position: absolute; background-color: cornsilk; min-width: 180px; box-shadow: 0 10 12 0 rgba(0, 0, 0, 0.5 ); z-index: 1; } .drcontent a { color: black; padding: 12px 14px; text-decoration: none; text-align: center; display: block; } .drcontent a:hover {background-color: #f1f1f1;} .drd:hover .drcontent { display: block; }
<ul class="dr"> <li class="dr"><a href="#top">Top</a></li> <li class="dr"><a href="#somewhere1">Locate 1</a></li> <li class="dr drd"><a href="javascript.void()" class="dropbtn1">Dropdown</a> <div class="drcontent"> <a href="#somewhere1">Locate 1</a> <a href="#somewhere2">Locate 2</a> <a href="#somewhere3">Locate 3</a> </div> </li> </ul>
コメント
コメントを投稿