The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

2 Pages V  1 2 >  
Reply to this topicStart new topic
> Making a border, I can make a border around every element from the website, but not thi
HarryFlex
post Feb 6 2022, 05:29 AM
Post #1


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



Hi, I can now positioning the elements. Is it possible to teach me how to make a border around the entire webpage?

I will,provide you a new webpage.

Thanks, greetings to all of you.

Best wishes for promoting the html5 code.

Harry


Attached thumbnail(s)
Attached Image

Attached File(s)
Attached File  webpagina.txt ( 4.83k ) Number of downloads: 232
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 8 2022, 12:42 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



The outermost element of a webpage is the <body>, so you simply apply the css border properties you want to 'body'.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 8 2022, 10:31 AM
Post #3


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



QUOTE(Brian Chandler @ Feb 8 2022, 12:42 AM) *

The outermost element of a webpage is the <body>, so you simply apply the css border properties you want to 'body'.


Hi, that doesn’t seem to work. I get a border, but only around the heading. Can you help me, Brian?

Please, receive my new html-file…

I’ve made some changes to the body-command.

Please, receive the result…
Attached File  Janwebpagina.html ( 5.3k ) Number of downloads: 253
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 8 2022, 01:09 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



That's because you've positioned the content absolute. It takes up no space and doesn't make body expand. You can think of it as it sort of floats on top of everything.

This is a simple and straightforward page. You just complicate things by positioning everything. Don't position ARTICLE and use a margin instead. Also remove the zillion non-breaking spaces you've used to create a marginat the top of the page and use CSS margin instead.

Among other errors you've placed the start tag for a DIV in your style block.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 8 2022, 01:48 PM
Post #5


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



Well, your attempt at a page is still a complete mess. Here is the result of trying to validate it: https://validator.w3.org/nu/?doc=https%3A%2...ost%26id%3D3491

I can't see why the border around body does not appear, but the way to start is to clear out all of the junk. What are those peculiar bits between the first <head> and the </head>? Why do you have two <head> tags, and repeated <meta> content-type?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 8 2022, 02:01 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



As I said above the border doesn't expand because the content is AP and positioned outside BODY.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 12:09 AM
Post #7


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



No, I’ve made all of these changes and this didn’t put a corner around the entire page… angry.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 9 2022, 02:23 AM
Post #8


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(HarryFlex @ Feb 9 2022, 02:09 PM) *

No, I’ve made all of these changes and this didn’t put a corner around the entire page… angry.gif


What does the latest version look like? Have you tried validating it? Have you untangled the mess in the multiple <head> tags? You do not appear to understand even the most basic ideas of html syntax, so you cannot expect us just to believe you have "made all of these changes". Pandy explained why your border around body does not work: you have lots of bits positioned outside the body. Don't do this.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 04:23 AM
Post #9


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



Now, I’ve placed everything inside the body. This makes the file a disaster. Solution I propose: no border at all.


Attached File(s)
Attached File  x.html ( 5.35k ) Number of downloads: 205
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 9 2022, 05:15 AM
Post #10


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(HarryFlex @ Feb 9 2022, 06:23 PM) *

Now, I’ve placed everything inside the body. This makes the file a disaster. Solution I propose: no border at all.


You claim to be "coding websites", but you plainly do not have the first clue. Here is the basic structure of a valid html document:

CODE

<!DOCTYPE html>
<html>
  <head>
... the bits that go in the head ...
  </head>
  <body>
... the bits that go in the body - the whole text of the page, basically ...
  </body>
</html>


This means that you *must* have exactly one (1) <body> tag. Not two (2). Not none (0). The same applies to all of the start and end tags listed above. And more generally tags have to match: one <p> tag starts a 'paragraph', and one </p> tag ends it. (Then in html there are tags that do not "contain" anything, like <img>, so they do not need a closing tag.)

Unless you show that you understand this, and mend your file to fit these rules, I cannot see that anyone should try to help you, sorry.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 05:54 AM
Post #11


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



QUOTE(Brian Chandler @ Feb 9 2022, 05:15 AM) *

QUOTE(HarryFlex @ Feb 9 2022, 06:23 PM) *

Now, I’ve placed everything inside the body. This makes the file a disaster. Solution I propose: no border at all.


You claim to be "coding websites", but you plainly do not have the first clue. Here is the basic structure of a valid html document:

CODE

<!DOCTYPE html>
<html>
  <head>
... the bits that go in the head ...
  </head>
  <body>
... the bits that go in the body - the whole text of the page, basically ...
  </body>
</html>


This means that you *must* have exactly one (1) <body> tag. Not two (2). Not none (0). The same applies to all of the start and end tags listed above. And more generally tags have to match: one <p> tag starts a 'paragraph', and one </p> tag ends it. (Then in html there are tags that do not "contain" anything, like <img>, so they do not need a closing tag.)

Unless you show that you understand this, and mend your file to fit these rules, I cannot see that anyone should try to help you, sorry.


Thanks, I don’t agree nobody would help me out. I’ve contacted a private teacher.

Maybe helping somebody out will get better use of the HTML5 code, which is much more difficult than HTML4.

It also helps promoting the HTML5 code.

This post has been edited by HarryFlex: Feb 9 2022, 05:55 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 06:17 AM
Post #12


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



Okay, I’ve changed the file like you said, Brian. Please receive the file underneath.


Attached File(s)
Attached File  x.html ( 5.21k ) Number of downloads: 203
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 06:59 AM
Post #13


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



There’s some other reason to help somebody out: I’m highly motivated. I’ve changed the file again. I hope you give me an answer in return, Brian…


Attached File(s)
Attached File  x.html ( 5.16k ) Number of downloads: 201
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 9 2022, 09:38 AM
Post #14


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



Now ARTICLE is positioned: fixed, which also takes it out of the flow and BODY doesn't need to expand.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 09:42 AM
Post #15


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



QUOTE(pandy @ Feb 9 2022, 09:38 AM) *

Now ARTICLE is positioned: fixed, which also takes it out of the flow and BODY doesn't need to expand.



Do you think, position:=“inherit” is the best solution?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 9 2022, 10:46 AM
Post #16


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



No. I think not positioning it at all and use CSS margin to create distance to other stuff is the best solution.

No offense, but what you have looks like you have picked up random snips at different places and use them without knowing how things work. Not a good strategy, that.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 11:22 AM
Post #17


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



QUOTE(pandy @ Feb 9 2022, 10:46 AM) *

No. I think not positioning it at all and use CSS margin to create distance to other stuff is the best solution.

No offense, but what you have looks like you have picked up random snips at different places and use them without knowing how things work. Not a good strategy, that.


I do not agree that I’ve been picking something’s up. I have followed a course. But this was not ‘the best thing’ I have done…
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 9 2022, 03:02 PM
Post #18


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(HarryFlex @ Feb 9 2022, 08:59 PM) *

There’s some other reason to help somebody out: I’m highly motivated. I’ve changed the file again. I hope you give me an answer in return, Brian…


You didn't quite manage to make it fit the rules. Here's the beginning of the file, up to the end of <body>

CODE

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" href="stylesheet.css">    
<head>
<title>
</title>
  <meta http-equiv="content-type" content="text/html; charset=windows-1252">    
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"><style type="text/css"></head>


You have put the doctype as "html", which it is claimed means "html 5". So why do you next have an 'xhtml' declaration? This stops the validator from even reading the rest of the file.
https://validator.w3.org/nu/?doc=https%3A%2...ost%26id%3D3494

Then which bits do you think go inside the <head>? Clue: one of them is the <link> tag to include a stylesheet. Yours is not inside the <head> and will probably not work.

What is the point of an empty <title> tag?

Then the <meta> tag specifying the charset: do you understand what this means? Why are you specifying more than one - which encoding does the document actually use?

That's about 4 errors in 8 lines. You tell us you believe you could do html4, but html5 is "very hard"... but the basic structure of an html4 document is *exactly* the same. So if you could do it in html4, why can't you do it in html5?

Pandy has tried to explain many times about using fixed position - this is a Bad Idea except for very special bits.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 03:33 PM
Post #19


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



QUOTE(Brian Chandler @ Feb 9 2022, 03:02 PM) *

QUOTE(HarryFlex @ Feb 9 2022, 08:59 PM) *

There’s some other reason to help somebody out: I’m highly motivated. I’ve changed the file again. I hope you give me an answer in return, Brian…


You didn't quite manage to make it fit the rules. Here's the beginning of the file, up to the end of <body>

CODE

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" href="stylesheet.css">    
<head>
<title>
</title>
  <meta http-equiv="content-type" content="text/html; charset=windows-1252">    
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"><style type="text/css"></head>


You have put the doctype as "html", which it is claimed means "html 5". So why do you next have an 'xhtml' declaration? This stops the validator from even reading the rest of the file.
https://validator.w3.org/nu/?doc=https%3A%2...ost%26id%3D3494

Then which bits do you think go inside the <head>? Clue: one of them is the <link> tag to include a stylesheet. Yours is not inside the <head> and will probably not work.

What is the point of an empty <title> tag?

Then the <meta> tag specifying the charset: do you understand what this means? Why are you specifying more than one - which encoding does the document actually use?

That's about 4 errors in 8 lines. You tell us you believe you could do html4, but html5 is "very hard"... but the basic structure of an html4 document is *exactly* the same. So if you could do it in html4, why can't you do it in html5?

Pandy has tried to explain many times about using fixed position - this is a Bad Idea except for very special bits.


Believe it or not , I have a certain degree in HTML4, only it’s from 2002. Even html 4 gets old. I have a document from the Belgian Governement which proves it. I’m into HTML5 since a few months, and yes, compared to html4, it’s very hard to learn. You wonder who I am, better wonder what I want…
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
HarryFlex
post Feb 9 2022, 03:47 PM
Post #20


Member
***

Group: Members
Posts: 44
Joined: 19-January 22
Member No.: 28,232



The thing is: if you don’t want to help me: I’m fine. But I will pay a private teacher, so The things - for you - aren’t understandable, will be understood by me. Please, use and promote the HTML5 code. Don’t make anyone ridiculous and make the code accessible to each of us…
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 09:27 AM