/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] how can i call classes in css file from html file ?

In the html file i have this simple code:

[CODE]<!DOCTYPE html>
<html>
<head>
<title>JQuery Cycle Plugin – Basic Demo</title>
<link rel=”stylesheet” type=”text/css” href=”Vertical_Slider.css”>
<!– include jQuery library –>
<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js”></script>
<!– include Cycle plugin –>
<script type=”text/javascript” src=”http://malsup.github.com/jquery.cycle.all.js”></script>
<script type=”text/javascript”>
$(document).ready(function() {
$(‘.slideshow’).cycle({
fx: ‘fade’ // choose your transition type, ex: fade, scrollUp, shuffle, etc…
});
});
</script>
</head>
<body>
<div class=’.slideshow’>
<img src=”http://malsup.github.com/images/beach1.jpg” width=”200″ height=”200″ />
<img src=”http://malsup.github.com/images/beach2.jpg” width=”200″ height=”200″ />
<img src=”http://malsup.github.com/images/beach3.jpg” width=”200″ height=”200″ />
<img src=”http://malsup.github.com/images/beach4.jpg” width=”200″ height=”200″ />
<img src=”http://malsup.github.com/images/beach5.jpg” width=”200″ height=”200″ />
</div>
</body>
</html>[/CODE]

I created css file Vertical_Slider and in the css file i have two lines:

[CODE].slideshow { height: 232px; width: 232px; margin: auto }
.slideshow img { padding: 15px; border: 1px solid #ccc; background-color: #eee; }[/CODE]

If i put this css lines in the html inside style tags it will work fine but i want to call this slidehow from the html file.

What should i change/add in the html file to call the .slideshow ?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Rene_SNov 24.2014 — If you change your syntax your class settings will work.

e.g. <div class="slideshow"></div>
Copy linkTweet thisAlerts:
@ChocoladeauthorNov 24.2014 — [CODE]<!DOCTYPE html>
<html>
<head>
<title>JQuery Cycle Plugin - Basic Demo</title>
<link rel="stylesheet" type="text/css" href="Vertical_Slider.css">
<!-- include jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.slideshow').cycle({
fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});
});
</script>
</head>
<body>
<div class="slideshow"></div>
<img src="http://malsup.github.com/images/beach1.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach2.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach3.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach4.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach5.jpg" width="200" height="200" />
</body>
</html>[/CODE]


In the bottom i did: <div class="slideshow"></div>

But now i'm getting 3 other errors:

Two same errors on the css file: Failed to load resource: the server responded with a status of 404 (Not Found)

And one error in the html file: [cycle] terminating; too few slides: 0
Copy linkTweet thisAlerts:
@Rene_SNov 25.2014 — ok maybe try this:

<div class="slideshow">

your html code as it was before.....

</div>
Copy linkTweet thisAlerts:
@Kevin2Nov 25.2014 — The 404 results from either not having the file or the file not being in the location the HTML specifies. Currently that's the same folder as the HTML file.

Be that as it may, change
[code=html] <div class="slideshow"></div>
<img src="http://malsup.github.com/images/beach1.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach2.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach3.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach4.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach5.jpg" width="200" height="200" />
[/code]

to
[code=html] <div class="slideshow">
<img src="http://malsup.github.com/images/beach1.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach2.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach3.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach4.jpg" width="200" height="200" />
<img src="http://malsup.github.com/images/beach5.jpg" width="200" height="200" />
</div>
[/code]


Should be closer to what you want.
×

Success!

Help @Chocolade spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...