CSS - body {
background-color: #000000;
text-align: center;
}
button {
width: 200px;
height: 50px;
}
JS - function hello() {
alert("Hello!");
}
JS:
function hello() {
alert(“Hello!”);
}
if you call hello()
function you will see an alert message like:
CSS:
body {
background-color: #000000;
text-align: center;
}
this CSS code will set the background color to <body> ... </body>
tag to be equal to #000000 (which is black) and the text inside it will be aligned to center.
Example:
button {
width: 200px;
height: 50px;
}
the last snippet set the height
and width
properties to the <button> ... </button>
elements on the page.
Example:
You can use any online editor to check it on your own.
One of such editors is https://jsbin.com/
Good luck.
Thanks so much! Once I actually sat down and looked at it, I understood what I was doing!
Thanks so much! Once I actually sat down and looked at it, I understood what I was doing!
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.
See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>
) will also add backticks around text.
Note: Backticks are not single quotes.
Hey! Quick question, my Python code doesn’t print anything, even though I have programmed it to print. Anything that I print doesn’t show up, it just shows a blank terminal. I tried to add configurations to the program, but still nothing shows up. Any suggestions?
There’s no way to know without seeing the code. Why don’t you go ahead and create a topic in the Python subforum.