webサイト制作の勉強|2018月2月クラスブログ

webサイト制作の勉強に関する解説ブログです。

コーポレートサイトのトレース

header・slider・grid部分

<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>コーポレートサイトのトレース</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/wideslider.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="js/wideslider.js"></script>
</head>

<body>
<header>
<div class="inner">
<h1>コーポレートサイト</h1>
</div>
</header>

<div class="wideslider">
<ul>
<li><a href="#1"><img src="img/mainvis_290.jpg" alt="" /></a></li>
<li><a href="#2"><img src="img/mainvis_291.jpg" alt="" /></a></li>
<li><a href="#3"><img src="img/mainvis_292.png" alt="" /></a></li>
</ul>
</div><!--/.wideslider-->


<ul class="grid">
<li class="size-2x2"><a href="#">バナー1</a></li>
<li class="size-2x1"><a href="#">バナー2</a></li>
<li><a href="#">バナー3</a></li>
<li><a href="#">バナー4</a></li>
<li class="size-2x1"><a href="#">バナー5</a></li>
<li><a href="#">バナー6</a></li>
<li><a href="#">バナー7</a></li>
<li><a href="#">バナー8</a></li>
<li><a href="#">バナー9</a></li>
<li><a href="#">バナー10</a></li>
<li class="sp-on"><a href="#">バナー11</a></li>
</ul>
</body>
</html>

スタイルシート

@charset "utf-8";
/* CSS Document */

/*!
 * ress.css • v1.2.2
 * MIT License
 * github.com/filipelinhares/ress
 * 全ての要素にbox-sizing: border-box;.
 * 全ての背景画像にbackground-repeat: no-repeat.
 */html{box-sizing:border-box;overflow-y:scroll;-webkit-text-size-adjust:100%}*,:after,:before{background-repeat:no-repeat;box-sizing:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*{padding:0;margin:0}audio:not([controls]){display:none;height:0}hr{overflow:visible}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}summary{display:list-item}small{font-size:80%}[hidden],template{display:none}abbr[title]{border-bottom:1px dotted;text-decoration:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}code,kbd,pre,samp{font-family:monospace,monospace}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}input{border-radius:0}[role=button],[type=button],[type=reset],[type=submit],button{cursor:pointer}[disabled]{cursor:default}[type=number]{width:auto}[type=search]{-webkit-appearance:textfield}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}button,input,optgroup,select,textarea{font:inherit}optgroup{font-weight:700}button{overflow:visible}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:0;padding:0}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button:-moz-focusring{outline:1px dotted ButtonText}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}button,select{text-transform:none}button,input,select,textarea{background-color:transparent;border-style:none;color:inherit}select{-moz-appearance:none;-webkit-appearance:none}select::-ms-expand{display:none}select::-ms-value{color:currentColor}legend{border:0;color:inherit;display:table;max-width:100%;white-space:normal}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}img{border-style:none}progress{vertical-align:baseline}svg:not(:root){overflow:hidden}audio,canvas,progress,video{display:inline-block}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){position:absolute!important;clip:rect(0 0 0 0)!important}}[aria-busy=true]{cursor:progress}[aria-controls]{cursor:pointer}[aria-disabled]{cursor:default}::-moz-selection{background-color:#b3d4fc;color:#000;text-shadow:none}::selection{background-color:#b3d4fc;color:#000;text-shadow:none}ul,ol{list-style:none;}a{text-decoration:none;}.wrapper{overflow:hidden;}
 
 a {
 color: #222;
 }

/*PC用スタイル*/
.inner {
  max-width:960px;
  margin:0 auto;
}
/*ヘッダー部分*/
h1 {
  width:103px;
  height:26px;
  background:url(../img/head_logo_001.jpg) no-repeat;
  white-space:nowrap;
  text-indent:100%;
  overflow:hidden;
  margin:20px 0;
}


/*グリッド部分*/
.grid {
  overflow:hidden;
  width:940px;
  margin: 0 auto;
}
.grid>li {
  width:168px;
  height:168px;
  float:left;
  margin:10px;
  border:1px solid #dbdbdb;/*ボーダーの色は共通*/
}
.grid>li.size-2x2 {
  width:356px;
  height:356px;
}
.grid>li.size-2x1 {
  width:356px;
  height:168px;
}
.grid>li:nth-child(1) {
  background:url(../img/image_039.jpg) no-repeat center center/cover;
}
.grid>li:nth-child(2) {
  background:url(../img/image_041.jpg) no-repeat center center/cover;
}
.grid>li:nth-child(3) {
  background:url(../img/image_042.jpg) no-repeat center center/cover;
}
.grid>li:nth-child(4) {
  background:url(../img/image_036.png) no-repeat center center/cover;
}
.grid>li:nth-child(5) {
  background:url(../img/image_033.jpg) no-repeat center center/cover;
}
.grid>li:nth-child(6) {
  background:url(../img/image_043.png) no-repeat center center/cover;
}
.grid>li:nth-child(7) {
  background:url(../img/image_044.jpg) no-repeat center center/cover;
}
.grid>li:nth-child(8) {
  background:url(../img/image_018.jpg) no-repeat center center/cover;
}
.grid>li:nth-child(9) {
  background:url(../img/image_037.jpg) no-repeat center center/cover;
}
.grid>li:nth-child(10) {
  background:url(../img/image_223.png) no-repeat center center/cover;
}
.grid>li:nth-child(11) {
  background:url(../img/image_029.jpg) no-repeat center center/cover;
}
.grid>li>a {
  display:block;
  width:100%;
  height:168px;
  white-space:nowrap;
  text-indent:100%;
  overflow:hidden;
}
.grid>li.size-2x2>a {
  width:356px;
  height:356px;
}
.grid>li.size-2x1>a {
  width:356px;
  height:168px;
}
.grid>li:hover {
  opacity:0.7;
}






/*PCの時に見せたくないもの用のクラス*/
.sp-on {
  display:none;
}


@media screen and (max-width:959px){
/*タブレット用スタイル*/
/*グリッド部分*/
.grid {
  overflow:hidden;
  width:100%;
  margin: 0 auto;
}
.grid>li {
  width:18%;
  height:0;
  padding-bottom:18%;
  float:left;
  margin:1%;
}
.grid>li.size-2x2 {
  width:38%;
  height:0;
  padding-bottom:38%;
}
.grid>li.size-2x1 {
  width:38%;
  height:0;
  padding-bottom:18%;
}



}
@media screen and (max-width:640px){
/*SP用スタイル*/

.sp-on {
  display:block;
}

.grid>li {
  width:48%;
  height:0;
  padding-bottom:48%;
  float:left;
  margin:1%;
}
.grid>li.size-2x2 {
  width:98%;
  height:0;
  padding-bottom:48%;
}
.grid>li.size-2x1 {
  width:98%;
  height:0;
  padding-bottom:48%;
}
.grid>li:nth-child(1) {
  background:url(../img/image_040.jpg) no-repeat 70% center/cover;
}

}


今回使用したスライダーのプラグイン
black-flag.net

広告を非表示にする