Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Correct code for image url

Posted on 2012-12-28
5
Medium Priority
?
263 Views
Last Modified: 2013-01-31
Hey Experts.  I am trying to add a new feature to my website but I can't seem to get this code right (line #13, 18 and 24 below).  

/* This css requires Moving Boxes v2.02+ */

/* Inside slider shadow */
.mb-left-shadow, .mb-right-shadow {
	background: repeat-y scroll 0 0;
	height: 100%;
	position: absolute;
	top: 0;
	width: 10px;
}

.mb-left-shadow {
	background-image: url("files/webslider/demo/leftshadow.png");
	left: 0;
}

.mb-right-shadow {
	background-image: url("files/webslider/demo/rightshadow.png");
	right: 0;
}

/*** Left & Right Navigation Arrows ***/
a.mb-scrollButtons {
	background: url("files/webslider/demo/arrows.gif") no-repeat;
	margin: 0;
	top: 40%;
	/*  the margin-top below may be causing problems, so adjust the % above... */
	/*  margin-top: -29px; if you change the arrow images, you may have to adjust this (1/2 height of arrow image) */
	zoom: 1;
}

Open in new window


This one works for another section of the web page but I'm not sure how to use this portion of code to ref the location of the file for the one above.
img src="files/webslider/demo/1.jpg" alt="picture"

Open in new window


Thanks Experts!
0
Comment
Question by:samiam41
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Melih SARICA
ID: 38728827
in css trying using ' instead of "

/* This css requires Moving Boxes v2.02+ */

/* Inside slider shadow */
.mb-left-shadow, .mb-right-shadow {
	background: repeat-y scroll 0 0;
	height: 100%;
	position: absolute;
	top: 0;
	width: 10px;
}

.mb-left-shadow {
	background-image: url('files/webslider/demo/leftshadow.png');
	left: 0;
}

.mb-right-shadow {
	background-image: url('files/webslider/demo/rightshadow.png');
	right: 0;
}

/*** Left & Right Navigation Arrows ***/
a.mb-scrollButtons {
	background: url('files/webslider/demo/arrows.gif') no-repeat;
	margin: 0;
	top: 40%;
	/*  the margin-top below may be causing problems, so adjust the % above... */
	/*  margin-top: -29px; if you change the arrow images, you may have to adjust this (1/2 height of arrow image) */
	zoom: 1;
}

Open in new window

0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 1000 total points
ID: 38729184
Actually there should not be any quotes at all.  If removing them does not work then the problem is the path.  depending on the hierarchy of your file system you may have to do an absolute url right from the root, or a full url including the http:// or possibly ../files/

Without seeing the actual file system structure it is a guess, but clearly it is just a incorrect path that the browser can resolve that is the problem.

Cd&
0
 
LVL 9

Author Comment

by:samiam41
ID: 38731330
Thanks for the response experts.

Here is my question.  Is there a way to use the "img src" command in the top portion of code?
.mb-left-shadow {
	background-image: url('files/webslider/demo/leftshadow.png');
	left: 0;
}

.mb-right-shadow {
	background-image: url('files/webslider/demo/rightshadow.png');
	right: 0;

Open in new window


I would rather not use the the whole URL because the webhost makes it tricky.
0
 
LVL 19

Assisted Solution

by:Melih SARICA
Melih SARICA earned 1000 total points
ID: 38731354
css style url gets under css files path

so .. if ur css file is under

/css then
ur

background-image: url('files/webslider/demo/leftshadow.png');

code means

/css/files/webslider .... etc

as u see if ur files/webslider is under root path try adding / infront of files

like this


background-image: url('/files/webslider/demo/leftshadow.png');
0
 
LVL 9

Author Comment

by:samiam41
ID: 38731726
10-4  Thanks non_zero.  Testing it now.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

648 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question