+ 2
Background music
Is it possible to code music that will play in the background in HTML, so that when a viewer opens my website the music will start playing automatically in the background. Thank-you in advance.
7 Answers
+ 3
https://code.sololearn.com/WcaJTO58vAWm/?ref=app
I created this code and it's working with music. You can get a reference from here and start coding. When a user opens a website means when body load (onload event in HTML) just play the music.
+ 1
I am not making website here, in Sololearn. I'm using an editor called "Sublime Text".
0
Can you show me the code, please?
0
If I understand correctly, the background music is working using nit only HTML , but JS as well. Am I right?
0
An also, may I ask another question, please?
How can I make a button have more than one color?
At the moment, I am making the project of my dream. By September it should be finished.
0
I,too
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
MusicGenres genres = new MusicGenres();
int count = 0;
while (count<5)
{
genres[count] = Console.ReadLine();
count++;
}
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Following: " + genres[i]);
}
}
}
class MusicGenres
{
private string[] genres = new string[5];
//declare an indexer
public string this[int i]{
get{ return genres[i];}
set{ genres[i] = value;}
}
}
}