Jump to content

Ingolme

Moderator
  • Posts

    14,894
  • Joined

  • Last visited

  • Days Won

    176

Posts posted by Ingolme

  1. The content at the bottom of the page has to be manually put there by you, then you can have links that point to it using the #hash part of the URL

    In your page content your code should look like this:

    <abbr title="InterPlanetary File System">IPFS</abbr><sup><a href="#reference-1">1</a></sup>

    Then you have to add this to the references section of your page. The id attribute has to match the href of the link above.

    <h2>References</h2>
    <ol>
      <li id="reference-1"><a href="https://wikipedia.org/wiki/IPFS">IPFS on wikipedia</a></li>
    </ol>

     

    • Thanks 1
  2. Youtube URLs are not video files. If you'd like to embed a Youtube video onto your site you can find the correct HTML by clicking on the "Share" button on the Youtube video and then selecting "embed"

    Here's the code for your video:

    <iframe width="560" height="315" src="https://www.youtube.com/embed/Ubt7ypQ-qGc?si=GVmp2zue9Sa2kxHM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

     

  3. It depends on the structure of your HTML. You can try making each one of the boxes a flex-box and use flex box rules to center the image inside the box.

    div.gallery {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

     

  4. I thought I could make a couple of changes and explain how to fix it, but rewriting it to make it simpler was a better option.

    You don't need to set widths, heights and margins on everything. The grid divides all the space evenly into columns and rows which already have their width and heights automatically set. If you set a width, the box will change its size, but nothing around it will relocate to account for that because the space reserved for it by the grid hasn't changed.

    Here's some simplified CSS and I updated the class names in the HTML to be more meaningful. I fixed some mismatched <head> and <body> tags which might mess with the layout as well.

    <!DOCTYPE html>
    <html lang="en-us">
    <head>
    	<meta http-equiv="content-type" content="text/html" 
        charset=UTF-8>
        <link rel="stylesheet" type="text/css" 
        href="styles.css" media="screen" />
          <title>GRID</title>
    </head>
    <body>
          
      <div class="grid-container">
        <div class="name">Name</div>
        <div class="photo">Photo</div>
        <div class="birth">Birth</div>  
        <div class="birth-details">Date:<br>
                           Place:<br>
                           Mother:<br>
                           Father:</div>
        <div class="marriage">Marriage</div>
        <div class="marriage-details">Spouse:<br>
                           Date:<br>
                           Place:</div>
        <div class="death">Death</div>
        <div class="death-details">Date:<br>
                           Place:<br>
                           Burial: </div>
        <div class="children">Children</div>
        <div class="bio">Bio </div>
        <div class="thumbnails">Thumbnails</div>
      </div>
    </body>
          
    
    </html>

    CSS

    .grid-container 
    {
      display: grid;
      background-color: rgb(234, 217, 201);
      row-gap: .25px;
      margin-left: auto;
      margin-right: auto;
      border-style:ridge; 
      border-width: 3px;
      border-radius:20px;
      width: 860px;
      grid-template-areas:
        'name name name name name name name name'
        'photo photo photo birth birth-details birth-details birth-details birth-details'  
        'photo photo photo marriage marriage-details marriage-details marriage-details marriage-details'
        'photo photo photo death death-details death-details death-details death-details'
        'bio bio bio bio bio bio bio bio'
        'children children children children children children children children'
        'thumbnails thumbnails thumbnails thumbnails thumbnails thumbnails thumbnails thumbnails';
    }
    
    .grid-container > div 
    {
      background-color: rgba(255, 255, 255, 0.8);
      text-align: left;
      padding-left: 9px;
      padding-top: 1px;
      font-size: 11px;
      border-style:ridge; 
      border-width: 2.5px;
      border-radius:20px;
      margin: 5px;
    }
    
    .grid-container > .name
    { 
      grid-area: name;
      height: 40px;
      margin-left: 130px;
      margin-right: 130px;
      margin-bottom: 10px;
      text-align: center;
      border-style:ridge; 
      border-width: 5px;
      border-radius:10px;
    }
    .photo { grid-area: photo; }
    .birth { grid-area: birth; }
    .birth-details { grid-area: birth-details; }
    .marriage { grid-area: marriage; }
    .marriage-details { grid-area: marriage-details;}
    .death { grid-area: death;}
    .death-details { grid-area: death-details; }
    
    .children 
    { 
      grid-area: children;
      height: 35px;
    }
    
    .bio 
    { 
      grid-area: bio; 
      height: 95px;
    }
    
    .thumbnails 
    { 
      grid-area: thumbnails; 
      height: 55px;
    }

     

  5. I answered the first one in your other thread. It selects items inside the container.

    .flex-container is a class selector. It selects any element where which has class="flex-container" as an attribute. You could replace "flex-container" with anything you like. The information about the class selector is on this page: https://www.w3schools.com/css/css_selectors.asp

    align-items centers them vertically. If you want horizontal centering you can use justify-content. Here's a reference page for justify-content: https://www.w3schools.com/cssref/css3_pr_justify-content.php

    When you don't set the width of an element it automatically fills the entire width available. You can give it a width but in most cases this standard behavior is desirable.

    Yes, the numbers are text and they're centered horizontally due to the text-align property.

  6. Here's an example, paste this into the TryIt editor:

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    body {margin:0;}
    
    .navbar {
      overflow: hidden;
      background-color: #333;
      position: fixed;
      top: 0;
      width: 100%;
    }
    
    .navbar a {
      float: left;
      display: block;
      color: #f2f2f2;
      text-align: center;
      padding: 14px 16px;
      text-decoration: none;
      font-size: 17px;
    }
    
    .navbar a:hover {
      background: #ddd;
      color: black;
    }
    
    .main {
      padding: 16px;
      margin-top: 30px;
      height: 1500px; /* Used in this example to enable scrolling */
    }
    
    .anchor {
      padding-top:48px;
      margin-top: -48px;
    }
    </style>
    </head>
    <body>
    
    <div class="navbar">
      <a href="#section1">Section1</a>
      <a href="#section2">Section2</a>
      <a href="#contact">Contact</a>
    </div>
    
    <div class="main">
      <h1>Fixed Top Menu</h1>
      <h2>Scroll this page to see the effect</h2>
      <h2>The navigation bar will stay at the top of the page while scrolling</h2>
    
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <h2 class="anchor" id="section1">Section 1</h2>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <h2 class="anchor" id="section2">Section 2</h2>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
      <p>Some text some text some text some text..</p>
    </div>
    
    </body>
    </html>

     

  7. The internet has changed, forums are a mostly forgotten medium. People get their information from social media sites and Discord channels. Speaking of that, W3Schools has a Discord channel link under the "Services" menu of their website. The link to the forums is very tiny in the website footer.

×
×
  • Create New...