Quantcast
Channel: CSSタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8660

ページトップボタン

$
0
0

以下のようなページトップボタン(ページの右下当たりにあって、クリックすると一番上に戻ってくるやつ)を実装します。

image.png

まず、ボタンを置きたいhtmlに以下をコピペ

index.html.erb(など)
<p id="pagetop"><a href="#">↑ </a></p>

これがページトップの指令になります。

次に以下を該当cssファイルにコピペしましょう。

tweets.css
/*ページトップ設定*/#pagetop{margin-right:10px;clear:both;padding-bottom:40px;}#pagetopa{color:#FFF;/*文字色*/font-size:20px;/*文字サイズ*/background:grey;/*背景色*/text-decoration:none;text-align:center;display:block;float:right;border-radius:30px;/*角丸のサイズ*/width:50px;line-height:50px;}

良い感じになるかと思います!


Viewing all articles
Browse latest Browse all 8660

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>