The layout of my webpage shifts when viewed in the browser, however it appears fine in the Coda preview

Hi there, I'm a beginner in the world of coding. I recently encountered an issue with my code that seems to be causing some trouble. When I preview it in Coda, everything looks perfect. However, when I try to open it in Chrome, the layout gets all wonky. It seems to shift around as I resize the browser window. Do you have any idea what might be going wrong?

(Also, I'm struggling to get my slideshow background to work properly. Any suggestions on fixing this?)

I'd really appreciate any guidance you can offer!

Here is the link to my Jsfiddle and the CSS I've used: Check out My Website

/* StyleSheet */

        /* Your CSS code goes here */
  
      
<!doctype html>
      <title>Your Title Here</title>
      <link rel="stylesheet" type="text/css" href="yourstylesheet.css">
       <link href="https://fonts.googleapis.com/css?family=Merriweather|Quicksand" rel="stylesheet">
     </head>

Answer №1

Your HTML code in the fiddle is incorrect. It lacks essential elements like the <html> tag, has multiple instances of the <body> tag, and contains unclosed tags.

I recommend reviewing the fundamentals of HTML by visiting this resource and validating your code using a tool like W3C Validator before sharing it.

Below is a corrected version with proper structure:

<!-- CSS Styles -->
/* Your CSS styles go here */
<!doctype html>
<html>

  <head>
    <title>Your Title Here</title>
    <link rel="stylesheet" type="text/css" href="your-styles.css">
    <link href="https://fonts.googleapis.com/css?family=Merriweather|Quicksand" rel="stylesheet">
  </head>

  <body>
    <!-- Your HTML content goes here -->
  </body>
</html>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using AJAX to dynamically edit and update PHP data

The information displayed on my index.php page is fetched from a database using the mysqli_fetch_array function. The data is presented in a table format with fields like Name, Age, Email, and Update. An edit button allows users to modify the data. Here is ...

I am attempting to dynamically align the images of two articles. The exact heights of the containers are not specified. Can anyone provide guidance on how to achieve this?

My code snippets: <article class="featured"> <img src="http://www.placehold.it/300x100/ff0000"> <p> <!--Text--> </p> </article> <article class="sub-featured"> <img src="http://www.placeh ...

Aligning the block both vertically and horizontally

I've been trying to center a red block both horizontally and vertically like shown in the picture below, but it's not positioned correctly. I'm using Bootstrap 4. Can anyone point out what's wrong? https://i.sstatic.net/3ZGg6.png .p ...

Running a MySQL query within a WordPress post using shortcode? Keep it in the post and avoid sending it to the footer with

My MySQL code is functioning perfectly, and I have created a custom shortcode to embed the content within a post. However, I am facing an issue where the shortcode is executing below the footer. Initially, I suspected it was a problem with a plugin or them ...

Looking to retrieve the dynamic "Publish Date" value from a webpage using HtmlUnit in Java?

As part of a coding exercise, I am currently working on a project that involves comparing the current system date with dates on various web pages to determine if there are any new updates. While most of the pages work as expected, there is one particular p ...

What is the best way to update HTML element contents with new code without losing any associated JavaScript functions?

I am attempting to replace the content within $('#product_blocks') with new HTML while also maintaining the jQuery event listeners on a similar element ID. var newHtml= '<div id="clickme">hello this text will be replaced on click</ ...

Is it permissible to assign the same element as a child to multiple parent elements in jQuery?

Imagine you have the following HTML structure: <div id="first"></div> <div id="second"></div> Now, if you use JavaScript and JQuery to perform the following actions: var $child = $("<span id='child'>Hello</span ...

Utilizing SASS with Bootstrap 4 media breakpoints: A comprehensive guide

According to the information provided on the official Bootstrap website: Bootstrap writes its source CSS in Sass, making all media queries available via Sass mixins: @include media-breakpoint-up(xs) { ... } @include media-breakpoint-up(sm) { ... } @in ...

Manipulating CSS Class Properties Using JavaScript

In my JavaScript application, there is a functionality that loads a list of items for users to click and view detailed information in a separate div on the page. Users should be able to interact with and make modifications to these individual item overview ...

Cover the entire section with an image

I'm aiming to achieve a similar layout like this (using tailwind) : https://i.stack.imgur.com/G0oti.png Here's the current setup: <section class="bg-juli-white pt-24"> <div class="max-w-6xl mx-auto flex flex-col" ...

Failed to update the innerHTML attribute for the anchor tag

I'm attempting to apply styles through DOM manipulation using Angular's renderer2. I have successfully updated styles for all HTML elements except for anchors. In the example below, I am trying to replace the text www.url.com with World within ...

How can one retrieve an element based on its attribute?

Below is a custom tag/directive that I am using: <tile class="ng-scope gridster-item" tilevalue="1" gridster-item="tile" row="0" col = "0" ng-repeat="tile in selectedTiles"> </tile> I'm trying to figure out how to set focus on this eleme ...

Display information from a .js file onto an HTML webpage

I'm completely new to the world of server-side development and I'm attempting to navigate it on my own. Currently, I have a server written in JavaScript using Express and I'm trying to display some content on my HTML page that was sent from ...

Tips for changing font styles using Polymer

I'm new to working with Polymer.js and CSS. My goal is to have text in todo.item display normally when todo.done is false, and with a line-through style when todo.done is true. I'm considering using CSS for this task, but I'm unsure how to ...

Express will be used to return empty values to an array

I am currently in the process of learning how to use express, so I am relatively new to it. I am facing an issue where I am trying to send data from a form I created to an array, but unfortunately, it is adding empty values to the array. The values are dis ...

Is there a way to override a LESS variable inside a mixin?

Currently, I am incorporating LESS into one of my projects and I have a requirement to establish different color schemes for various users. The project involves developing a portal where the color scheme should change based on the type of user logging in. ...

The animation using Jquery and CSS is experiencing some glitches on Safari when viewed on an

Why is smooth animation not working on iPad Safari with jQuery animate? $('#myId').css({ 'left': '-100%' }).animate({ 'left': '0' }, 300, 'linear'); I also tried using the addClass option and in ...

Combining two HTML tables using jQuery/JavaScript

My table is displayed below: <table id="first" class="merge"> <tr> <td>Mick Jagger</td> <td>30</td> <td>50</td> <td>10</td> </t ...

Combining and removing identical values in JavaScript

I need to sum the price values for duplicated elements in an array. Here is the current array: var products = [["product_1", 6, "hamburger"],["product_2", 10, "cola"],["product_2", 7, "cola"], ["product1", 4, "hamburger"]] This is what I am aiming for: ...

inputting an array of strings into the value attribute of an input element using jQuery

Whenever a user writes something in the input field with id="clientAdd" and presses enter, that text should be displayed as a tag inside a div. These tags are then saved as an array of strings, which I want to pass as the value for the hidden input field w ...