Skip to main content
Participating Frequently
November 19, 2020
Answered

Problem with text area

  • November 19, 2020
  • 3 replies
  • 533 views

I'm writing a website from scrach and i my main body content its been overwrite on my topnav bar, i dont even what i got to do.I had some top Margin but it didn't work. i dont know if my code wrong or somethnig.
also i notice that my body section have just a size of 1032 x 32 i dont know if it for something and i dont know how to change it. 

Please help 

This topic has been closed for replies.
Correct answer osgood_

i forgot to delete the four last line, i kind weird, maybe its a merging probleme as u said


1) You need to add top: 0; to your nav css:

 

nav {
position: fixed;
top: 0;
background: linear-gradient(-20deg, #e9defa 0%, #fbfcdb 100%);

}

 

2) You don't have a .main css class, its just the 'main' html container you are using, so delete the period infront of the css selector name and add a top margin to the main container to push the content down so it becomes visible:

 

main {
margin: 12em 0 0 0;
}

 

When you have a fixed navigation and use css to push the content down its just really a bit of a guessing game. Use em instead of px for the top margin because if a user zooms their browser text at least the content gets pushed down. If you use px the content wont move down and you'll find the nav, if you keep zooming the text, will eventually obscure the content.

 

The idea is to keep the fixed navigation as narrow in depth as is possible, yours looks a bit deep to me for a fixed nav bar.

 

3 replies

Nancy OShea
Community Expert
Community Expert
November 19, 2020

@Mr. One 

In order to build websites, you need a working knowledge of HTML, CSS and to some extent JavaScript code. Without understanding code, it's unlikely you'll get the results you're hoping for. Read the chapters, do code exercises and take quizzes at the end.
- https://www.w3schools.com/html/
- https://www.w3schools.com/css/
- https://www.w3schools.com/js/

Validate your code and fix reported errors.  In DW, go to Window > Results > Validation.  Check current document. See screenshot.

 

 

Nancy O'Shea— Product User & Community Expert
Mr. OneAuthor
Participating Frequently
November 19, 2020

I have already done all the HTML tutorial and CSS Tutorial lessons and test
I'm actually working on my javascript and C++ skill while i'm building my website.

Mr. OneAuthor
Participating Frequently
November 19, 2020

also its not the first website i build i have never seen such a problem but its my first time using dreamweaver for that purpose so i'm a bit confuse

Legend
November 19, 2020

To be of any help we need to see the code you are using. Can you paste the code and any css the page uses in the forum or better still if you are able to upload the page to a remote server and provide a link to it.

Mr. OneAuthor
Participating Frequently
November 19, 2020

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>Pata'Sucre</title>

<!-- Custom Style-->
<link rel="stylesheet" href="css/styles.css">

</head>


<body>
<!------------------Navigation------------>
<header>
<nav class="topnav">
<div class="nav-menuflex-row">
<div class="toggle-collapse">
<div class="toggle-icons">
<i class="fas fa-bars"></i>
</div>
</div>
<div>
<ul class="nav-item">
<div class="nav-brand"> <a href="#" class="logo-header"> <img src="img/logo.png" height="105" width="105"></a> </div>
<li class="nav-link">
<a href="#" class="nav-button">Home</a>
</li>
<li class="nav-link">
<a href="#" class="nav-button">Product</a>
</li>
<li class="nav-link">
<a href="#" class="nav-button">Gallery</a>
</li>
<li class="nav-link">
<a href="#" class="nav-button">Contact</a>
</li>
<li class="nav-link">
<a href="#" class="nav-button">About Us</a>
</li>
</ul>
</div>
<div class="social">
<a href="#"><img src="img/Social/Facebook Black.png" title="Facebook" class="social-png"></a>
<a href="#"><img src="img/Social/Instagram Black.png" title="Instragram" class="social-png"></a>
<a href="#"><img src="img/Social/Email Black.png" title="Email" class="social-png"></a>
<a href="#"><img src="img/Social/Paypal Black.png" title="Paypal" class="social-png"></a>
</div>
</div>
</nav>
</header>

<!--------MAIN SITE SECTION---------------->
<main>
<div class="main-welcome"><h1>A Tasty World</h1></div>
</main>

<!---------x-----MAIN SITE SECTION-------x--->


<!-----------x----Navigation-----x----->
<!--------Custom Javascript File -------->
<script src="./js/main.js"></script>
</body>
</html>

Community Expert
November 19, 2020

We still need to see the rest of the code included for this page (ie: CSS).   This is only part of the puzzle because if you have issues with margins those would be in your CSS document which needs to be assessed alongside your HTML.

Community Expert
November 19, 2020

You are going to need to post a link to the page in question or code from your page to review.  Without seeing the code it is difficult to say exactly what is causing your issue.