Jump to content
Sign in to follow this  
Poryafm12

I Can't Set the background Color Using HTML for the Whole page except I put a text for that!

Recommended Posts

To Whom may concern,


I was making a background color for HTML using visual studio, I used this code for set the background color:

<html>
<head>
<title>Page Title</title>
</head>
<body style="background-color: aqua">
A text.
</body>
</html>

But When I saw the preview for that, It's just set the background text for TEXTS that typed in Body. I want to make it for the whole page. I already tried this code for set the background color:

<html>
<head>
<title>Page Title</title>
</head>
<body bgcolor="aqua">
A text.
</body>
</html>

 

Is there any way for me to do the whole page by a specific color?

Share this post


Link to post
Share on other sites

Hi there,

Welcome to the forums!

In the example you've placed here, the HTML document doesn't actually cover "the whole page" if you're referring to the browser window. The only part that fills up is the body.

You might be able to apply some combination of these styles so that it does fill in the browser window.

html {
   margin: 0px;
   height: 100%;
   width: 100%;
}

body {
   margin: 0px;
   min-height: 100%;
   width: 100%;
}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...