Click here to Skip to main content
14,241,320 members
Rate this:
Please Sign up or sign in to vote.
See more:
So I am a very new coder on the block, actually probably should not even consider myself a coder but that's besides the point. I am building a web/blog page with images/icons on the left and and text on the right. How can I make it where the images are alternating? I believe it would be a cleaner look on the web page but because of my lack of knowledge on HTML I am quite lost. Please help if you can!

What I have tried:

Haven't tried much in all honesty I am afriad to mess up certain work and be more lost than I currently am.
Posted
Updated 14-Jun-19 7:12am
Comments
Mohibur Rashid 12-Jun-19 2:15am
   
I am not exactly sure what do you mean by alternating image. How does this "alternating image" will work in practice?
Rate this:
Please Sign up or sign in to vote.

Solution 3

It may be that it's style that you're thinking of rather than (or along with?) HTML

Check Here for how styles work - I put you in the middle of things but there's a tutorial that's very user friendly for both HTML and CSS: CSS Pseudo-elements[^]

In this case, find the pseud-element reference page and one allows skipped formatting. I once used it to simulate "green bar" paper.
   
Rate this:
Please Sign up or sign in to vote.

Solution 4

Quote:
How to make alternating images on HTML code?

Computer programming is the art of being precise, and your question is not. There is at least 3 different things that match what you said.
Server side: you have a lot of images and you want to link a different one each time a client request the page:
- the server code pick a random image each time the page is requested.
- you have a counter and it is incremented each time the page is requested, then save new counter, when at the end of list, go back to first.
Client side:
- in Javascript, you set a timer (every 30 seconds1) which launch a piece of code that replace the image tag with another one. and you have a counter to keep track of last image.
HTML Tutorial[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

using img tag in html code with alt property solved you problem.
   
Comments
Mohibur Rashid 12-Jun-19 2:14am
   
Before jumping into conclusion to such a vague question, you should ask the OP, what he really wants to do.
Rate this:
Please Sign up or sign in to vote.

Solution 2

You can use "alt" tag inside image tag to insert alternate images in HTML code. Collaboratively, you may also use width and height of the image to make the size of image constant.

<img src="image.jpg" alt="Aternate-text-you-want-to-add" width="150" height="270">
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100