Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • 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.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • 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

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.
 
[CODE lang="css" title="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;
}[/CODE]
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>
 
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;
}
 
<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:

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom