2017-02-05 15 views
0

私が持っている問題は、アイコンにリンクを追加する前に、視覚的に私が望むようにレイアウトされていることです。それから私は彼らにリンクをつけてクリック可能にして、ポジションを変えます。私はこの問題の原因を正確に突き止めることができないので、誰かがそれを知っているか実際に役立つことが分かっている場合はそうすることができません。ありがとう!最初のスニペットは私が望むデザインとレイアウトで、2番目のスニペットはリンクの問題です。フレックスボックスのリンクボタンの応答の問題

.container { 
 
    display: flex; 
 
    background-color: #1DA0A3; 
 
    flex-flow: row wrap; 
 
    \t max-width:1700px;    
 
    margin: 0 auto;  
 
} 
 
    
 
    .box{ 
 
    flex: 1 0 200px; 
 
    display: flex; 
 
    flex-flow: column wrap; 
 
    margin:1em; 
 
\t 
 
\t transition: all 0.3 ease-in-out; 
 
\t 
 
    } 
 

 
.box::after{ 
 
\t z-index:-1; 
 
\t opacity:0; 
 
\t box-shadow:0 5px 15px rgba(0,0,0,0.3); 
 
\t transition: opacity 0.3s ease-in-out; 
 
} 
 

 
.box:hover{ 
 
\t transform: scale(1.05, 1.05); 
 
\t box-shadow: 0 1px 2px black; 
 
} 
 

 
.box:hover:after{ 
 
\t opacity:1; 
 
} 
 
    
 
    .box img{ 
 
    align-self: center; 
 
    width: 180px; 
 
    margin-bottom: 1em; 
 
\t padding-top:10px; 
 
    } 
 
    
 
    .box .buy{ 
 
    align-self: center; 
 
    margin-top: auto; 
 
    } 
 

 

 
.flexwords{ 
 
\t align-self: center; 
 
\t margin-top: auto; 
 
} 
 

 
#contacticon{ 
 
\t \t width:100px; 
 
\t }
<div id="colorbk"> 
 

 
    <div class="container"> 
 
    
 
    <div class="box"> 
 
     <img src="computericon.svg" alt="" id="lapicon" /> 
 
     <h2 class="flexwords">My Work</h2> 
 
     
 
    </div> 
 
    
 
    <div class="box"> 
 
     <img src="haticon.svg" alt="" id="haticon" /> 
 
     <h2 class="flexwords">My Education</h2> 
 
    </div> 
 
     
 
    
 
    <div class="box"> 
 
     <img src="tieicon.svg" id="contacticon" alt="" /> 
 
     <h2 class="flexwords">Contact Me</h2> 
 
     
 
    </div> 
 
     
 
     
 
<br> 
 

 
<hr class="hr1"> 
 

 

 
<div class="wrap"> 
 
<main> 
 
<aside> 
 
\t <h1>Do You Want to...</h1> 
 
    <ul> 
 
    <li>Rebrand yourself online</li> 
 
    <li>Take your current website and make it modern</li> 
 
    <li>Find a way to make information more accessible for customers</li> 
 
    <li> Improve customer service</li> 
 
    <li> Reach a wider range of people</li> 
 
</ul> 
 
</aside> 
 
<article> 
 
<h1>Do You Want to...</h1> 
 

 
<ul> 
 
    <li>Create forms and documents that customers can fill out online</li> 
 
    <li>Start an email list for recurring customers</li> 
 
    <li>Show relatability with your audience</li> 
 
    <li> Have 24/7 online exposure</li> 
 
    <li>Create a map or a way for customers to find your location</li> 
 
</ul> 
 
</article> 
 

 
</main> 
 
</div> 
 
</div> 
 
\t </div>

.container { 
 
    display: flex; 
 
    background-color: #1DA0A3; 
 
    flex-flow: row wrap; 
 
    \t max-width:1700px;    
 
    margin: 0 auto;  
 
} 
 
    
 
    .box{ 
 
    flex: 1 0 200px; 
 
    display: flex; 
 
    flex-flow: column wrap; 
 
    margin:1em; 
 
\t 
 
\t transition: all 0.3 ease-in-out; 
 
\t 
 
    } 
 

 
.box::after{ 
 
\t z-index:-1; 
 
\t opacity:0; 
 
\t box-shadow:0 5px 15px rgba(0,0,0,0.3); 
 
\t transition: opacity 0.3s ease-in-out; 
 
} 
 

 
.box:hover{ 
 
\t transform: scale(1.05, 1.05); 
 
\t box-shadow: 0 1px 2px black; 
 
} 
 

 
.box:hover:after{ 
 
\t opacity:1; 
 
} 
 
    
 
    .box img{ 
 
    align-self: center; 
 
    width: 180px; 
 
    margin-bottom: 1em; 
 
\t padding-top:10px; 
 
    } 
 
    
 
    .box .buy{ 
 
    align-self: center; 
 
    margin-top: auto; 
 
    } 
 

 

 
.flexwords{ 
 
\t align-self: center; 
 
\t margin-top: auto; 
 
} 
 

 
#contacticon{ 
 
\t \t width:100px; 
 
\t }
<div id="colorbk"> 
 

 
    <div class="container"> 
 
    
 
    <a href="skills.html"><div class="box"> 
 
     <img src="computericon.svg" alt="" id="lapicon" /> 
 
     <h2 class="flexwords">My Work</h2> 
 
     
 
    </div></a> 
 
    
 
    <a href="about.html"><div class="box"> 
 
     <img src="haticon.svg" alt="" id="haticon" /> 
 
     <h2 class="flexwords">My Education</h2> 
 
    </div></a> 
 
     
 
    
 
    <a href="contact.html"><div class="box"> 
 
     <img src="tieicon.svg" id="contacticon" alt="" /> 
 
     <h2 class="flexwords">Contact Me</h2> 
 
     
 
    </div></a> 
 
     
 
     
 
<br> 
 

 
<hr class="hr1"> 
 

 

 
<div class="wrap"> 
 
<main> 
 
<aside> 
 
\t <h1>Do You Want to...</h1> 
 
    <ul> 
 
    <li>Rebrand yourself online</li> 
 
    <li>Take your current website and make it modern</li> 
 
    <li>Find a way to make information more accessible for customers</li> 
 
    <li> Improve customer service</li> 
 
    <li> Reach a wider range of people</li> 
 
</ul> 
 
</aside> 
 
<article> 
 
<h1>Do You Want to...</h1> 
 

 
<ul> 
 
    <li>Create forms and documents that customers can fill out online</li> 
 
    <li>Start an email list for recurring customers</li> 
 
    <li>Show relatability with your audience</li> 
 
    <li> Have 24/7 online exposure</li> 
 
    <li>Create a map or a way for customers to find your location</li> 
 
</ul> 
 
</article> 
 

 
</main> 
 
</div> 
 
</div> 
 
\t </div>

答えて

1

単にこれはシームレスに働いていたアンカーadivを交換し、それに

body { 
 
    background-image: url(footer_lodyas.png); 
 
} 
 
ml, 
 
body { 
 
    width: 100%; 
 
    height: 100%; 
 
} 
 
.center { 
 
    margin-left: auto; 
 
    margin-right: auto; 
 
    display: block; 
 
} 
 
/***************flexbox icons************/ 
 

 
.container { 
 
    display: flex; 
 
    background-color: #1DA0A3; 
 
    flex-flow: row wrap; 
 
    justify-content: center; 
 
} 
 
.box { 
 
    flex: 1 0 200px; 
 
    display: flex; 
 
    flex-flow: column wrap; 
 
    margin: 1em; 
 
    max-width: 300px; 
 
} 
 
.box img { 
 
    align-self: center; 
 
    width: 180px; 
 
    margin-bottom: 1em; 
 
} 
 
.box .buy { 
 
    align-self: center; 
 
    margin-top: auto; 
 
} 
 
.flexwords { 
 
    align-self: center; 
 
    margin-top: auto; 
 
} 
 
#contacticon { 
 
    width: 100px; 
 
} 
 
/****************horizontal line*************/ 
 

 
.hr1 { 
 
    border: none; 
 
    border-bottom: 1px solid #293839; 
 
    margin-left: 25%; 
 
    width: 50%; 
 
    color: #485A5F; 
 
    height: 2px; 
 
} 
 
/***************Do you want to section*************/ 
 

 
.wrap { 
 
    display: flex; 
 
} 
 
main { 
 
    flex: 1; 
 
    display: flex; 
 
    justify-content: center; 
 
} 
 
aside, 
 
article { 
 
    padding: 2em; 
 
} 
 
aside { 
 
    flex: 0 auto; 
 
} 
 
article { 
 
    flex: 0 auto; 
 
} 
 
@media (max-width: 800px) { 
 
    main { 
 
    flex-direction: column; 
 
    align-items: center; 
 
    } 
 
}
<html> 
 

 
<head> 
 
    <meta charset="UTF-8"> 
 
    <link href="index.css" rel="stylesheet"> 
 

 
    <title>portfolio</title> 
 
</head> 
 

 
<body> 
 

 
    <div class="container"> 
 

 
    <a class="box" href="skills.html"> 
 
     <img src="http://icons.iconarchive.com/icons/designbolts/free-multimedia/1024/iMac-icon.png" alt="" /> 
 
     <h2 class="flexwords">My Work</h2> 
 
    </a> 
 

 
    <a class="box" href="about.html"> 
 
     <img src="http://icons.iconarchive.com/icons/designbolts/free-multimedia/1024/iMac-icon.png" alt="" /> 
 
     <h2 class="flexwords">My Education</h2> 
 
    </a> 
 

 
    <a class="box" href="contact.html"> 
 
     <img src="http://icons.iconarchive.com/icons/designbolts/free-multimedia/1024/iMac-icon.png" id="contacticon" alt="" /> 
 
     <h2 class="flexwords">Contact Me</h2> 
 
    </a> 
 

 
    <br> 
 

 
    <hr class="hr1"> 
 

 

 
    <div class="wrap"> 
 
     <main> 
 
     <aside> 
 
      <h1>Do You Want to...</h1> 
 
      <ul> 
 
      <li>Rebrand myself online</li> 
 
      <li>Take my current website and make it modern</li> 
 
      <li>Find a way to make information more accessible for customers</li> 
 
      <li>Improve customer service</li> 
 
      <li>Reach a wider range of people</li> 
 
      </ul> 
 
     </aside> 
 
     <article> 
 
      <h1>Do You Want to...</h1> 
 

 
      <ul> 
 
      <li>Create forms and documents that customers can fill out online</li> 
 
      <li>Start an email list for recurring customers</li> 
 
      <li>Show relatability with my audience</li> 
 
      <li>Have 24/7 online exposure</li> 
 
      <li>Create a map or a way for customers to find my location</li> 
 
      </ul> 
 
     </article> 
 

 
     </main> 
 
    </div>

+0

boxクラスを設定!ありがとう@LGSon私は本当にそれを感謝します。 – Cakers

+0

@Cakers大歓迎です – LGSon

1

a要素の代わりに、それらの内側のdiv要素に.boxを追加します。

<div id="colorbk"> 

    <div class="container"> 

    <a href="skills.html" class="box"><div> 
     <img src="computericon.svg" alt="" id="lapicon" /> 
     <h2 class="flexwords">My Work</h2> 

    </div></a> 

    <a href="about.html" class="box"><div> 
     <img src="haticon.svg" alt="" id="haticon" /> 
     <h2 class="flexwords">My Education</h2> 
    </div></a> 


    <a href="contact.html" class="box"><div > 
     <img src="tieicon.svg" id="contacticon" alt="" /> 
     <h2 class="flexwords">Contact Me</h2> 

    </div></a> 


<br> 

<hr class="hr1"> 


<div class="wrap"> 
<main> 
<aside> 
    <h1>Do You Want to...</h1> 
    <ul> 
    <li>Rebrand yourself online</li> 
    <li>Take your current website and make it modern</li> 
    <li>Find a way to make information more accessible for customers</li> 
    <li> Improve customer service</li> 
    <li> Reach a wider range of people</li> 
</ul> 
</aside> 
<article> 
<h1>Do You Want to...</h1> 

<ul> 
    <li>Create forms and documents that customers can fill out online</li> 
    <li>Start an email list for recurring customers</li> 
    <li>Show relatability with your audience</li> 
    <li> Have 24/7 online exposure</li> 
    <li>Create a map or a way for customers to find your location</li> 
</ul> 
</article> 

</main> 
</div> 
</div> 
    </div> 

https://jsfiddle.net/s70u1ddz/

関連する問題