Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help 

Why isn't my HTML document linking properly to my CSS file?

So I try this HTML document I have been working on as presented in the video:

Code
<!DOCTYPE html>

<html>
    <head>
        <meta charset="utf-8">
        <title>Amazon Checkout</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="type/css" href="styling.css">
    </head>

    <body>
        <form>
            [b]<!--[/b]
            <label for="address">Address:</label>
            <input type="text" name="address" id="address" placeholder="Address" size="30px" maxlength="100">
            <br />
            <label for="postcode">Postcode:</label>
            <input type="text" name="postcode" id="postcode" placeholder="Postcode" size="30px" maxlength="100">
            <br />
            <label for="city">City:</label>
            <input type="text" name="city" id="city" placeholder="City" size="30px" maxlength="100">
            <p>Choose your shipping method:</p>
            <select name="shipping" id="shipping">
                <option value="Free super saver shipping">Free super saver shipping</option>
                <option value="Two-Day shipping">Two-Day shipping</option>
                <option value="One-Day shipping">One-Day shipping</option>
            </select>
            <p>Choose your payment method:</p>
            <label>Paypal<input type="radio" name="payment" value="paypal"></label>
            <label>Debit Card<input type="radio" name="payment" value="debit card"></label>
            <label>Credit Card<input type="radio" name="payment" value="credit card"></label>
            <br />
            <label for="comments">Comments:</label>
            <textarea rows="4" cols="40" name="comments" id="comments"></textarea>
            <br />
            <label>Sign me up for email updates<input type="checkbox" name="email updates" checked="checked"></label>
            <br />
            <label>Securely save my payment details<input type="checkbox" name="save payment"  checked="checked"></label>
            <br />
            <input type="submit" value="Submit">
          -->
          <div class="container">
            A
          </div>
          <div class="submit">
            B
          </div>
        </form>
    </body>


</html>

And here's the CSS code:

Code
* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
}

form {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 10px;
}

.container {
  background-color: greenyellow;
}

.submit {
  background-color: darkred;
  margin-top:auto;
}

Could someone please point out why it doesn't link properly to the CSS code? I really need help with this. I googled it and got someone else who asked and got an answer someone gave to that guy who asked and that person's answer didn't work.

I can't figure out why my CSS code just doesn't quite link.

Why isn't my code linking!? It makes no sense!!!


I fixed it!!!

Part of the css link was wrong.
I see that you fixed it, but I want to make sure it's obvious to everyone else.

Take note of the type attribute.
Code
<link rel="stylesheet" type="type/css" href="styling.css">

Fixed code
Code
<link rel="stylesheet" type="text/css" href="styling.css" />

Je t'aime
[Image: fpZ5a5g.png]

(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.
was going to say, gotta love making sure syntax is correct cause one small move everything falls
(Oct 9, 2019 08:29 AM)de_g3ntl3m4n Wrote:  was going to say, gotta love making sure syntax is correct cause one small move everything falls

Agreed. A Capital letter, a wrongly placed space, etc. can cause issues.
(Oct 9, 2019 08:30 AM)Deal Wrote:  Agreed. A Capital letter, a wrongly placed space, etc. can cause issues.
Except, neither of these two things you listed would cause an issue with most HTML elements, let alone a link element.

Valid
Code
<link rel="stylesheet" type="text/css" href="style.css" />

Valid
Code
<LINK rel="stylesheet" type="text/css" href="style.css" />

Valid
Code
<link rel=" stylesheet " type="text/css" href="style.css" />

Valid
Code
<link Rel="stylesheet" type="text/css" href="style.css" />

Heck, even this is valid
Code
<link rel=" Stylesheet " type="text/css" href="style.css" />

Valid
Code
<link rel= "stylesheet" type="text/css" href="style.css" />

You get the point. Don't spew nonsense just to rack posts up.

Je t'aime
[Image: fpZ5a5g.png]

(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.
(Oct 9, 2019 08:41 AM)Nachfolger Wrote:  Except, neither of these two things you listed would cause an issue with most HTML elements, let alone a link element.

Valid
Code
<link rel="stylesheet" type="text/css" href="style.css" />

Valid
Code
<LINK rel="stylesheet" type="text/css" href="style.css" />

Valid
Code
<link rel=" stylesheet " type="text/css" href="style.css" />

Valid
Code
<link Rel="stylesheet" type="text/css" href="style.css" />

Heck, even this is valid
Code
<link rel=" Stylesheet " type="text/css" href="style.css" />

Valid
Code
<link rel= "stylesheet" type="text/css" href="style.css" />

You get the point. Don't spew nonsense just to rack posts up.


I’m talking generally. Not just in relation to one fucking line you giant dumbass.
So a capital letter doesn’t affect selectors? A capital letter does not affect attributes? If his css is called styles.css but he writes Styles.css that doesn’t affect it?

Giant moron. Shut the fuck up who are you even


Possibly Related Threads...
Thread / Author Replies Views Last Post
by blackcoder00May 30, 2026 03:02 PM 2 103 May 30, 2026 03:02 PM
Last Post: blackcoder00
by emadaldin1Mar 29, 2023 07:59 AM 2 137 Mar 29, 2023 07:59 AM
Last Post: emadaldin1
[Help] by HamwareNov 22, 2022 07:27 AM 0 325 Nov 22, 2022 07:27 AM
Last Post: Hamware