LoginSignup
0
0

More than 3 years have passed since last update.

〜CSSの基本〜

Last updated at Posted at 2020-06-02

以下に注意して修正する

top → 上
bottom → 下のこと

padding→中身だけ動かしたい
margin→背景ごと動かす

margin: 0 auto; [左右]に対して中央に配置

ショートハンド指定
padding: ○px; 四方向共通
padding: ○px ○px; 上下 左右
padding: ○px ○px ○px; 上 左右 下
padding: ○px ○px ○px ○px; 上 右 下 左

計算する番
width : calc(100% - 20px) ;

< ブロックの位置指定を固定するために!>
絶対位置指定の仕方

position: absolute;で
スタート位置を指定。

position: relative;を親に記載すれば
親基準のスタート位置となる。

◆以下をCSSに記載

※子要素に追加
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin:auto;

※親腰輿に追加
position: relative;

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0