Skip to main content
Participant
May 22, 2019
Question

My background image shows up on Dreamweaver but not live preview or on safari

  • May 22, 2019
  • 2 replies
  • 481 views

This is my html code:

<!doctype html>

<html>

<head>

<meta charset="UTF-8">

<title>Emma Designer for Hire</title>

<link href="file:///Macintosh HD/Users/emmadalenberg/Desktop/styles.css" rel="stylesheet" type="text/css">

<link href="styles.css" rel="stylesheet" type="text/css">

<!--The following script tag downloads a font from the Adobe Edge Web Fonts server for use within the web page. We recommend that you do not modify it.--><script>var __adobewebfontsappname__="dreamweaver"</script><script src="http://use.edgefonts.net/actor:n4:default;alfa-slab-one:n4:default.js" type="text/javascript"></script>

</head>

<body>

<nav>Home About Portfolio Contact</nav>

<header><img src="Logo.png" width="80" height="80" alt=""/></header>

<aside class="asideLeft">

  <h1>What can I create for you?</h1>

</aside>

<section class="sectionRight">

  <h2>Creating Compelling Branding</h2>

  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus </p>

</section>

<footer>Copyright 2017. Made with 100% recycled pixels. </footer>

</body>

</html>

This is my CSS Code:

@charset "UTF-8";

@1552174 url("Website/styles.css");

body {

    background-image: url(Ex_Files_Dreamweaver_CC2017_Website/Exercise%20Files/Assets/bkgd.jpg);

    background-size: cover;

    background-attachment: fixed;

    font-family: actor;

    font-style: normal;

    font-weight: 400;

    height: 100%;

}

h1 {

    font-family: alfa-slab-one;

    font-style: normal;

    font-weight: 400;

    font-size: 2em;

    text-align: center;

    line-height: 2em;

}

h2 {

    font-family: alfa-slab-one;

    font-style: normal;

    font-weight: 400;

    font-size: 1.5em;

    text-align: center;

}

footer {

    font-size: small;

    text-align: center;

    float: none;

    clear: both;

}

header {

    text-align: center;

    margin-top: 70px;

}

.aside left {

    width: 30%;

}

.asideLeft {

    width: 28%;

    height: 0%;

    float: left;

    margin-right: 1%;

}

.sectionRight {

    width: 55%;

    float: right;

    margin-right: 5%;

    margin-top: 30px;

    margin-left: 1%;

    padding-top: 2.5%;

    padding-right: 2.5%;

    padding-bottom: 2.5%;

    padding-left: 2.5%;

    opacity: 1;

    background-image: -webkit-linear-gradient(270deg,rgba(255,255,255,1.00) 0%,rgba(255,255,255,0.58) 100%);

    background-image: -moz-linear-gradient(270deg,rgba(255,255,255,1.00) 0%,rgba(255,255,255,0.58) 100%);

    background-image: -o-linear-gradient(270deg,rgba(255,255,255,1.00) 0%,rgba(255,255,255,0.58) 100%);

    background-image: linear-gradient(180deg,rgba(255,255,255,1.00) 0%,rgba(255,255,255,0.58) 100%);

    border-top-right-radius: 25px;

}

This topic has been closed for replies.

2 replies

Nancy OShea
Community Expert
Community Expert
May 22, 2019

Hi Emma,

Delete this line of code.  It won't work when the site is online.

<link href="file:///Macintosh HD/Users/emmadalenberg/Desktop/styles.css" rel="stylesheet" type="text/css">

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
Community Expert
May 22, 2019

It looks to me like you may not be working from a Defined Site.

Defining a new site

That needs to be done first, even if you're only making HTML newsletters. You just leave the FTP info out in that case.

If you are working from a defined site, relink your .css file. Right now it's using an absolute link to your local hard drive. That needs to be changed so others can read from the correct location (on their systems, the location doesn't exist)