Home > Blockchain >  Why is the the text "help" not visible, blue border of div(class=main) not visible and red
Why is the the text "help" not visible, blue border of div(class=main) not visible and red

Time:03-26

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lost and Found</title>
    <link rel="stylesheet" href="style.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Anton&display=swap" rel="stylesheet">
</head>

<body>
    <div  >
        <img src="img.png" alt="logo" srcset="">
        <div ><span>Electronincs</span></div>
        <div ><span>Plastics</span></div>
        <div ><span>Wearables</span></div>
        <div ><span>Others</span></div>
        <input id="srch" type="search" value="Search">
    </div>

    <div >
    <div >
        <p>Help</p>

    </div>




    </div>
        
</body>
</html>
*{
    margin: 0px;
    padding: 0px;

}

.nav{
    background-color:bisque;
    width: 100%;
    height: 60px;
    display: flex; 
    align-items: center;
    position: fixed;

}

.b{
    height: 60px;
    width: 10%;
    background-color: antiquewhite;
    margin: 2px;
    justify-content: center;
    font-family: 'Anton', sans-serif;
    border-radius: 20px;
    align-items: center;
    display: flex;
}
img{
    width: 80px;
    height: 60px;
}

#srch{
width: 10%;
height:60px;
right: 0%;
position:fixed;
font-size: larger;
}

.main{
   height: 1000px;
   width: 100%;
   border-color: blue;
    background-color:lightgoldenrodyellow;
}

.head{
    width: 100%;
    height: 554px;
    border-color:red ;
}

Why is the the text "help" not visible, blue border of div(class=main) not visible and red border of div(class=head) not visible?

i am beginner trying to learn web development. i have successfully created the fixed navigation bar and am struggling to make a box taking up 50% of the width (will put an image in the remaining 50%).

.

CodePudding user response:

Why is the the text "help" not visible

Because it is covered by the navigation pane, which you gave position: fixed.

Why is ... blue border of div(class=main) not visible and red border of div(class=head) not visible?

Because you didn't set the border-style. For instance, add border-style: solid;

CodePudding user response:

Why is the the text "help" not visible,

Because it's underneath your navbar

.main{
   padding-top: 60px;
}

/* or alternatively */

.head {
    margin-top: 60px;
}

blue border of div(class=main) not visible and red border of div(class=head) not visible?

You need to set a border width and style along with the color

.main {
    border: 1px solid blue;
}

.head{
    border: 1px solid red ;
}

Also, you seem to have made a mistake copying and pasting this line:

<link href="<link rel="preconnect" href="https://fonts.googleapis.com">

CodePudding user response:

Where is "help" its under the nav bar because u set it fix

Where is my "Border" you only set color but didn't set his style, you can use border to set everything in there

border: 1px solid blue;

About the layout of you web you can use easy layout as this by change only css

 .nav {
    background-color: bisque;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
  }
  .main {
    padding-top:60px;
    height: 100%;
    width: 100%;
    border-color: blue;
    border-style: solid;
    background-color: lightgoldenrodyellow;
    border: 1px
  }

by setting fixed as before and set border of main content to skip some content under navbar and you can set height:100% too !

  • Related