• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.
    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Linking Images and Text not working anymore

ryanforprez

New Coder
Hello,

I am a relatively new coder and I ran into a problem where my text and images do not link anymore.

I will share the text one that is not working


HTML:
<div class="header1"><a href="index.html"><h4>DUMmY<br>
STUDIO</h4></a>
</div>

<div class="header2"><a href="index.html"><p>Information</p></a>
</div>


CSS:
.header1 {
width: 15%;
position: fixed;
padding-left: 0%;
padding-top: 0px 0px;
padding-right: 10px 10px;
font-size: 22px;
line-height: 25px;
font-family: DummySans;
letter-spacing: .35px;

}
.header2 {
width: 30%;
position: fixed;
padding-left: 65%;
padding-top:01%;
padding-right: 10px 10px;
font-size: 22px;
line-height: 45px;
font-family: Sans;
letter-spacing: .35px;
}





ALSO: If anyone knows how to click on something for it to appear and click on it again to disappear I am trying to figure that out.
 

ryanforprez

New Coder
style:
.header1 {
    width: 15%;
    position: fixed;
 padding-left: 0%;
    padding-top: 0px 0px;
    padding-right: 10px 10px;
    font-size: 22px;
    line-height: 25px;
    font-family: DummySans;
    letter-spacing: .35px;

}
.header2 {
    width: 30%;
    position: fixed;
        padding-left: 65%;
        padding-top:01%;
    padding-right: 10px 10px;
    font-size: 22px;
    line-height: 45px;
    font-family: Sans;
    letter-spacing: .35px;
}
HTML:
<div class="header1"><a href="index.html"><h4>DUMmY<br>
        STUDIO</h4></a>
    </div>

    <div class="header2"><a href="index.html"><p>Information</p></a>
    </div>
 

edenwax

Active Coder
The culprit seems to be position: fixed - or at least, if I remove that CSS from the .header1/.header2 classes the links work properly.

Try this code instead and see if it works any better:

HTML:
<header class="test-header">
  <div class="header1">
    <a href="index.html">
      <h4>DUMmY<br/>STUDIO</h4>
    </a>
  </div>
  <div class="header2">
    <a href="index.html">
      <p>Information</p>
    </a>
  </div>
</header>

CSS:
.test-header {
  width: 100%;
  position: fixed;
  display: flex;
  justify-content: space-between;
}

.header1 {
    width: 15%;
    padding-left: 0%;
    padding-top: 0px 0px;
    padding-right: 10px 10px;
    font-size: 22px;
    line-height: 25px;
    font-family: DummySans;
    letter-spacing: .35px;

}
.header2 {
    width: 30%;
    padding-left: 65%;
    padding-top:01%;
    padding-right: 10px 10px;
    font-size: 22px;
    line-height: 45px;
    font-family: Sans;
    letter-spacing: .35px;
}
 

ryanforprez

New Coder
<header class="test-header">
<div class="header1">
<a href="index.html">
<h4>DUMmY<br/>STUDIO</h4>
</a>
</div>
<div class="header2">
<a href="Information.html">
<p>Information</p>
</a>
</div>
</header>



HTML:
.test-header {
  width: 100%;
  position: fixed;
  display: flex;
  justify-content: space-between;
}

.header1 {
    width: 15%;
    padding-left: 0%;
    padding-top: 0px 0px;
    padding-right: 10px 10px;
    font-size: 22px;
    line-height: 25px;
    font-family: DummySans;
    letter-spacing: .35px;

}
.header2 {
    width: 75%;
    padding-left: 58%;
    padding-top:01%;
    padding-right: 10px 10px;
    font-size: 22px;
    line-height: 45px;
    font-family: Sans;
    letter-spacing: .35px;
}
 
Last edited:
Top Bottom