CSS code that is displaying as plain text on some computers, however it is functioning correctly on my own

I've been working on my home page, and everything was going smoothly. However, whenever I share it with someone else, the CSS doesn't seem to work properly. When I check the code on their laptop, it seems like it's being read as plain text rather than code. I've shared my entire code just in case there's an issue elsewhere. For context, I saved it as a .html document on Firefox. There are no errors when loaded, but the CSS just doesn't function. I'm new to HTML and CSS, so it might be something really simple.

<!DOCTYPE html>
<html>

<head>
  <title>Home</title>

  <style type="text/css">
    a:link {
      color: black;
    }
    
    a:visited {
      color: black;
    }
    
    a:hover {
      color: #327da8;
    }
    
    .name {
      font-size: 20px;
      font-color: black;
      font-family: montserrat;
      text-decoration: none;
      position: absolute;
      margin-top: 360px;
      text-align: left;
      border-width: 1px;
      border-style: solid;
      border-color: lightgray;
      padding: 27.5px;
      border-radius: 0px 0px 15px 15px;
    }
    
    a img {
      border-radius: 50%;
      display: block;
      border: none;
    }
    
    .navbar {
      text-decoration: none;
      padding-left: 30px;
      padding-right: 30px;
      font-family: montserrat;
      font-weight: 150;
    }
    
    body {
      background-image: url("file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/The%20Lost%20Dogs%20Home.png");
      background-repeat: no-repeat;
      background-position: left top;
      background-attachment: fixed;
      background-size: 200px, 600px;
    }
    
    a:hover~.name {
      color: #327da8;
      border-color: #327da8;
    }
    
    img {
      border: 10px solid black;
    }
  </style>
</head>

<body>

  <nav>
    <table style="margin-left:190px;margin-right:auto; margin-top:45px; font-size:20px;">
      <tr>
        <th><a class="navbar" href="PupLove.html">Home</a></th>
        <th><a class="navbar" href="PupLoveDonate.html">Donate</a></th>
        <th><a class="navbar" href="PupLoveCare.html">How to take care of a dog</a></th>
        <th><a class="navbar" href="PupLoveContacts&FAQ's.html">Contacts and FAQ's</a></th>
        <th><a class="navbar" href="PupLoveBlog.html">Blog</a></th>
  </nav>
  </tr>
  </table>

  <div>
    <a href="PupLoveNala.html"><img style="position:absolute; margin-top:60px; margin-left:50px; border-radius:15px 15px 0px 0px;" src="https://www.yourpurebredpuppy.com/dogbreeds/photos-EFGH/goldenretrieversf1.jpg" height="300" width="200"></a>
    <a class="name" style="margin-left:50px;" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveNala.html">Nala <br><br> Breed: Golden <br> Retriever <br><br> Sex: Female</a></div>

  <div>
    <a href="PupLoveBillie.html"><img style="position:absolute; margin-top:60px; margin-left:350px; border-radius:15px 15px 0px 0px;" src="https://www.yourpurebredpuppy.com/dogbreeds/photos-EFGH/greatdanesf5.jpg" height="300" width="200"></a>
    <a class="name" style="margin-left:350px; padding:36.5px" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveBillie.html">Billie <br><br> Breed: Great <br> Dane <br><br> Sex: Male</a></div>

  <div>
    <a href="PupLoveBendi.html"><img style="position:absolute; margin-top:60px; margin-left:650px; border-radius:15px 15px 0px 0px;" src="https://www.yourpurebredpuppy.com/dogbreeds/photos-AB/australiancattledogsf1.jpg" height="300" width="200"></a>
    <a class="name" style="margin-left:650px; padding:41px" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveBendi.html">Bendi <br><br> Breed: Blue <br> Heeler <br><br> Sex: Male</a></div>

  <div>
    <a href="PupLoveRufus.html"><img style="position:absolute; margin-top:60px; margin-left:950px; border-radius:15px 15px 0px 0px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Bearded_collie_and_a_rope.jpg/640px-Bearded_collie_and_a_rope.jpg" height="300" width="200"></a>
    <a class="name" style="margin-left:950px; padding:21px" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveRufus.html"><br>Rufus <br><br> Breed: Bearded <br> Collie <br><br> Sex: Male<br>ㅤ</a>
  </div>

</body>

</html>

Answer №1

Your code appears to have some improperly closed tags that need correction. I've made the necessary adjustments following coding standards:

    <!DOCTYPE html>
<html>
<head>
<title>Home</title>

<style>
a:link {
  color: black;
}

a:visited {
  color: black;
}

a:hover {
  color: #327da8;
}

.name {
  font-size:20px;
  color:black;
  font-family:montserrat;
  text-decoration:none; position:absolute;
  margin-top: 360px; text-align:left; border-width:1px;
  border-style:solid; border-color:lightgray;
  padding: 27.5px;
  border-radius:0px 0px 15px 15px;
}

a img {
  border-radius: 50%;
  display: block;
  border: none;
}

.navbar {
text-decoration:none; padding-left:30px; padding-right:30px; font-family:montserrat; font-weight:150;
}

body {
background-image: url("file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/The%20Lost%20Dogs%20Home.png");
background-repeat: no-repeat;
background-position: left top;
background-attachment: fixed;
background-size: 200px, 600px;
}

a:hover ~ .name { 
color: #327da8; 
border-color: #327da8;
}

img {
border:10px solid black;
}
</style>
</head>

<body>

<nav>
<table style="margin-left:190px;margin-right:auto; margin-top:45px; font-size:20px;">
<tr>
<th><a class="navbar" href="PupLove.html">Home</a></th>
<th><a class="navbar" href="PupLoveDonate.html">Donate</a></th>
<th><a class="navbar" href="PupLoveCare.html">How to take care of a dog</a></th>
<th><a class="navbar" href="PupLoveContacts&FAQ's.html">Contacts and FAQ's</a></th>
<th><a class="navbar" href="PupLoveBlog.html">Blog</a></th>
</tr>
</table>
</nav>

<div><a href="PupLoveNala.html"><img style="position:absolute; margin-top:60px; margin-left:50px; border-radius:15px 15px 0px 0px;" src="https://www.yourpurebredpuppy.com/dogbreeds/photos-EFGH/goldenretrieversf1.jpg" height="300" width="200"></a>
<a class="name" style="margin-left:50px;" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveNala.html">Nala <br><br> Breed: Golden <br> Retriever <br><br> Sex: Female</a></div>

<div><a href="PupLoveBillie.html"><img style="position:absolute; margin-top:60px; margin-left:350px; border-radius:15px 15px 0px 0px;" src="https://www.yourpurebredpuppy.com/dogbreeds/photos-EFGH/greatdanesf5.jpg" height="300" width="200"></a>
<a class="name" style="margin-left:350px; padding:36.5px" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveBillie.html">Billie <br><br> Breed: Great <br> Dane <br><br> Sex: Male</a></div>

<div><a href="PupLoveBendi.html"><img style="position:absolute; margin-top:60px; margin-left:650px; border-radius:15px 15px 0px 0px;" src="https://www.yourpurebredpuppy.com/dogbreeds/photos-AB/australiancattledogsf1.jpg" height="300" width="200"></a>
<a class="name" style="margin-left:650px; padding:41px" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveBendi.html">Bendi <br><br> Breed: Blue <br> Heeler <br><br> Sex: Male</a></div>

<div><a href="PupLoveRufus.html"><img style="position:absolute; margin-top:60px; margin-left:950px; border-radius:15px 15px 0px 0px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Bearded_collie_and_a_rope.jpg/640px-Bearded_collie_and_a_rope.jpg" height="300" width="200"></a>
<a class="name" style="margin-left:950px; padding:21px" href="file:///C:/Users/del0044/OneDrive/HTML%20Coding/PupLove/PupLoveRufus.html"><br>Rufus <br><br> Breed: Bearded <br> Collie <br><br> Sex: Male<br>ㅤ</a></div>

</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

Scrolling back to the top of the page using Jquery instead of a specific div

Check out the code for my project here. The isotope feature is functioning correctly, however, when clicking on the image, instead of scrolling to the navigation under the red box as intended, the page scrolls all the way to the top. If I modify the follo ...

Excessive Expansion of Website Width

Initially, I crafted a website on my local server, and it had the ideal width. Afterwards, I uploaded it to the live server and made some design modifications. To my surprise, there is now an unexpected scroll bar at the bottom of the page, causing the s ...

Mastering the Art of Harnessing External Templates in Meteor Mantra

I have been diving into the Mantra style guide () in order to integrate it with meteor. What confuses me is determining the "right" approach for using external templates with meteor and mantra. Specifically, I'm unsure about handling CSS and JS files. ...

Switch Image to Background Image on Mobile Devices

I am currently working on a website that needs a special page for an upcoming event. Typically, the pages on this site have a mast banner image that stretches across the full width of the page. However, for this particular page, it is necessary for the ima ...

Replace the current CSS styles of a pre-installed package

I recently added a package for a type writer effect, but I'm having trouble with it not overriding the CSS styles I've set in the component. Here's an example of what I have: <template> <v-row class="hero" align-content= ...

The browser prevented the script located at “http://127.0.0.1:5500/assets/platform.png” from loading due to an invalid MIME type of “image/png”

Sorry if this question seems repetitive, but despite extensive searching, I haven't been able to find a solution to my specific problem. I am currently working on developing a basic JavaScript game, but I'm facing challenges when it comes to impo ...

Prevent the ability to add options dynamically to a drop-down select list

I have implemented a dynamic data retrieval feature from my database using jQuery's .getJSON function and appended the data to an HTML select drop-down list. The JavaScript code for this functionality is as follows: $.getJSON('url', f ...

Tips for centering elements in an image caption

I need some help with separating an image and text within an image caption from each other. Currently, they are overlapping and I want them to be distinct. I attempted using inner div elements for the text and image separately, but it caused issues by brea ...

Lagging speeds in client-side template rendering using Rivets.js

I have a function that renders an array of around 1000 objects, but the html bindings are causing significant performance issues. It currently takes about 5 seconds to complete rivets.bind(). Does anyone have any recommendations for improving performance? ...

Successful PHP submission confirmation

I have implemented a basic PHP script on my website to handle email sending. <?php $headers ="From:<$from>\n"; $headers.="MIME-Version: 1.0\n"; $headers.="Content-type: text/html; charset=iso 8859-1"; mail($to,$su ...

Using PHP to send date and time form fields to MySQL

I have been searching for a solution in the community forums, and the closest answer I found was in the thread titled "trying-to-post-date-via-php-with-mysql-need-help" My issue involves a form with 2 input fields - one for date selection using an HTML5 p ...

Achieving consistent image column heights that decrease evenly

I am trying to create a grid-like layout where each column in a row has the same height and contains an image while maintaining its proportions. Currently, I am using the flex-grow property to adjust the ratio of the images. Although this works, it often ...

How to Show Byte Array Image in AngularJS HTML Using a Web API Service

I am in the process of developing an AngularJS Application and for my service, I am utilizing .NET C# for coding purposes. I am currently following the code structure outlined in a previous post about loading images from a C# Byte array and placing them in ...

Align the div in the center horizontally

Looking at this page, my goal is to center the main #container div horizontally in relation to the page. In a typical scenario, I would simply add a CSS rule like this, #container { margin: 0 auto } However, the layout of this specific page (which I didn ...

Selecting a pair of radio buttons to toggle the visibility of different div elements using JavaScript

I've been working on two radio button categories that control the visibility of different input fields. I'm making progress, but I'm still struggling to get it to work perfectly. Below are the images for reference: The combination of &apos ...

Centered Bootstrap 4 modal with responsive width

Struggling to create a BootStrap 4 Modal that is centered in the screen and adjusts its width based on content? You're not alone. Despite trying different approaches like the container fluid and CSS methods, achieving a variable width modal is proving ...

Angular routing does not properly update to the child's path

I've organized my project's file structure as follows: app/ (contains all automatically built files) app-routing.module.ts components/ layout/ top/ side/ banner/ pages/ ...

What is the best way to make sure images and text are properly aligned for different screen sizes

I'm a beginner with Bootstrap and could use some assistance. In my code, I have text and images divided into four columns with alignment set based on screen size using media queries in CSS. However, when resizing the window to tablet view (check Scre ...

Guide to autoplay an uploaded mp4 video in a flask application

I've been working on a Flask application that includes an upload button for videos in mp4 format. I'm facing an issue where after uploading a video, it only shows a generic grey screen without playing the video. I want to ensure that once a video ...

What is the best way to show a locally stored image in a React application while using a local server?

I have come across a few discussions regarding the display of images in react, but none of them seem to address my specific issue. To start, I initiated a project using npx create-react-app, and then utilized the npm start feature that was included in the ...