Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2019
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need to know if im coding CSS and HTML the right way

    I've been working on a website and I was just wondering if I was coding right, I still dont understand how to use div or the difference between header and head. I also don't understand when to use class or nav. I've started learning html and CSS 2 days ago.

    Sent from my SM-N950U using Tapatalk

  2. #2
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    11,215
    Thanks
    6
    Thanked 1,347 Times in 1,316 Posts
    Hi and welcome to CodingForums,

    Did you know that there is a key (or key combination) on the keyboard that creates proper screenshots? For Apple computers that would be Cmd-Shift-3 for the entire screen or Cmd-Shift-4 for an arbitrary area of your screen (and optionally hit the space bar after the Cmd-Shift-4 combination to create a screenshot for a whole particular window of an application). And did you also know that you could just copy and paste any text into the text field here in the forum? That way we can better analyze your code. We could even try it ourselves without typing everything manually.

    That said, the first thing you should read about would be the concept of semantic HTML. This way you’ll know when to use divisions (“divs”) and when to use other elements, and which ones in which context. In a nutshell: div is a generic and non-semantic block-level container, i. e. it is to be used if you need an element without any particular meaning, for example to group other elements in one container.

    The difference between <head> and <header> is that the former defines the document header, i. e. all the meta information for a particular HTML document that defines some things that are pertaining to the document but isn’t supposed to be shown as actual content. The latter defines headers of content sections in the document body. <head> can only occur once in a document and must come before <body>. <header> can occur multiple times inside <body>.

    Here is a simplified example:
    Code:
    <!DOCTYPE html>
    <html>
        <head>
            <title></title>
            <meta charset="utf-8" />
            <meta name="description" content="" />
            <meta name="keywords" content="" />
        </head>
        <body>
            <header></header>
            <main>
                <section>
                    <header></header>
                    <div>content</div>
                </section>
                <article>
                    <header></header>
                    …
                    …
                </article>
            </main>
            <footer></footer>
        </body>
    </html>

  3. #3
    New to the CF scene
    Join Date
    Jan 2019
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you!

    Sent from my SM-N950U using Tapatalk

  4. #4
    Banned
    Join Date
    Jan 2019
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, Don't see the Web Development and Design is so hard it's all easy and learns in a creative way. In Html, the <div>...</div> tags are used for creat blocks as same as sections, for example, if you want to place image and text at one cloumn and video on other column and these two must be on same row. Then you will use the div tags for each column and rows. later you can style them as a inline-block elements in CSS code.

    Difference between the header and the head is where the <head>..</head> tag is used to place meta tags, keywords, meta descriptions, linking CSS files, javascript files, linking google fonts those all links which are no visible at front-end of your website wil place in head tag. <header>...</header> tags mostly used for placing nav menu, header contact details, slider section in you home page. <nav>....</nav> tag is used for the menu of your website.

    Finally Class and ID are used to style the website or design the website look and feel. These are mostly used in CSS files and Javascript files.

    If you want to learn thigns completely goto edx.org, coursera.org, udacity which will teach you a highend coding on web development in easy way.
    Last edited by vinyl-junkie; Jan 5th, 2019 at 07:02 AM. Reason: self-promotional link removed


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •