Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (1 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?

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.
 
Share this answer
 
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[^]
 
Share this answer
 
using img tag in html code with alt property solved you problem.
 
Share this answer
 
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.
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">
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900