• Hello, when I tried creating a page and posting with the code below I am getting 404 page not found. How do I fix this?

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    div {
        background-color: lightgrey;
        width: 125px;
        border: 5px solid green;
        padding: 25px;
        margin: 25px;
    }
    </style>
    </head>
    <body>
    
    <h2>Rice</h2>
    
    <p>The CSS box model is essentially a box that wraps around every HTML element. It consists of: borders, padding, margins, and the actual content.</p>
    
    <div><p><a href="http://singcompare.x10.mx/rice/golden-pineapple/">Golden Pineapple</a></p></div>
    </body>
    </html>
    
    </style>
    </head>
    <body>
    
    <div><p><a href="http://singcompare.x10.mx/rice/golden-pineapple/">Golden Pineapple</a></p></div>
    </body>
    </html>
Viewing 8 replies - 1 through 8 (of 8 total)
  • Ummm, what does this have to do with WordPress? Are you creating a page in wordpress and inserting all that in the text of the page?

    You need a better explaination of your issue.

    Thread Starter ivanlau88888

    (@ivanlau88888)

    Ummm, what does this have to do with WordPress? Are you creating a page in wordpress and inserting all that in the text of the page?

    Yes, but when I publish it I will get 404 page not found. I believe there’s something wrong with the code but I’m not sure what is it.

    Yes, but when I publish it I will get 404 page not found.

    1) when you publish it where?
    2) is this happening in the backend when you hit update?
    3) why do you have two(2) <body>…</body> sections?

    Thread Starter ivanlau88888

    (@ivanlau88888)

    1) Pages > Add New > Insert the code on Text > Publish
    2) Yes
    3) I wanted to have two boxes, not sure if I’m doing wrong.

    Your code is all messed up try this

    <h2>Rice</h2>
    
    	<p>The CSS box model is essentially a box that wraps around every HTML element. It consists of: borders, padding, margins, and the actual content.</p>
    
    <div><p><a href="http://singcompare.x10.mx/rice/golden-pineapple/">Golden Pineapple</a></p></div>
    
    <div><p><a href="http://singcompare.x10.mx/rice/golden-pineapple/">Golden Pineapple</a></p></div>

    You can deal with the css by using a plugin link ‘my custom css’ to add your css for this

    Thread Starter ivanlau88888

    (@ivanlau88888)

    Hello,

    Do you mind copying the code from the first post and paste it to http://www.w3schools.com/css/tryit.asp?filename=trycss_default ? I wanted it to look something like shown inside the W3schools tryit editor.

    I prefer the box to show beside each other and not one top one bottom as in the code above, not sure how to make it show beside each other instead.

    For the my custom css, whatever code I put inside it will affect the entire website right? Is it possible for it to affect only a single page or a few page?

    Thanks for your effort in helping me

    First, when you changed the code to what I showed, did the 404 go away?

    Second, CSS will apply the rules (things like ‘color: red;’ or ‘font-size: 45px;’) to all elements and child elements that match the selector. Selectors can be very general or very specific.

    You need to take some tutorials on CSS and HTML and the use google to ask something like ‘use css to place div side by side

    Thread Starter ivanlau88888

    (@ivanlau88888)

    First, when you changed the code to what I showed, did the 404 go away?

    Yes

    Second, CSS will apply the rules (things like ‘color: red;’ or ‘font-size: 45px;’) to all elements and child elements that match the selector. Selectors can be very general or very specific.

    Is it possible to put CSS on HTML?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Posting CSS code in page give 404 error’ is closed to new replies.