CSS id issues with styles [closed] - html

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to get each individual span element to be hidden for some jQuery effects but, the display:none; style is not affecting any of the ids associated with it
#a1, #a3, #a4, #a5, #a6, #a7, #a8, #a9, #a10, #a11, #a12, #a13, #14,
#a15, #16, #a17, #a18, #a19, #a20, #a21, #a22, #a23, #a24, #a25, #a26,
#a27, #a28, #a29, #a30, #a31, #a32, #a33
{
display:none;
}

class name or ID name can't start with a number check this. #14. If you change this as #a14 then this will work fine.
and same as #16 also

Try like this :
<!DOCTYPE html>
<html>
<head>
<style>
#a1,#a2,#a3{display:none;}
</style>
</head>
<body>
<h1>This is a visible heading</h1>
<h1 id="a1">This is a hidden heading</h1>
<h1 id="a2">This is a hidden heading</h1>
<h1 id="a3">This is a hidden heading</h1>
<p>Notice that the hidden heading does not take up space.</p>
</body>
</html>
Dont Start an ID with a NUMBER

Related

Link visible according to date [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 days ago.
Improve this question
I have an html where I need to show a link after a determined date, For example I want that the link href='https://sample.it' will be visible only after 2023-02-25
I have no idea how to do
Assuming you are not using anything special, one of the possible solutions is to use PHP: put this code around your <a>.
<?php
if((new DateTime("now")) > (new DateTime('2023-02-25'))) {
?>
<a ...>...</a>
<?php
}
?>
We can do it using html and javascript
var currentdate = new Date();
if (currentdate < Date.parse('2023-02-25')) {
document.getElementById('link').style.display = 'none';
}
<!DOCTYPE html>
<html>
<title>HTML Tutorial</title>
<body>
<h1>This is a heading</h1>
<a href='https://sample.it' id='link'>https://sample.it</a>
</body>
</html>

How do I change a text after clicking an image in html? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
Code I think
the door + text
the door changes into a open door after clicking it but is there a way for the 'woah' to change into for example 'text2' after clicking the closed door??
I'm new to html so I don't know much
someone told me to use document.getElementById but didn't give me any more information and I do not know where to put in the id
You can achieve what you want with basic Javascript, but if you don't know it yet, consider finding some good tutorial to get started.
The code you're looking for is something like
<!doctype html>
<html>
<head>
<title>Update Image and Text</title>
<!-- Define your function here -->
<script>
function updateImageAndText() {
//Update image url
document.getElementById("image").src = "https://via.placeholder.com/150/FFFF00/000000?text=open+door";
//Update paragraph text
document.getElementById("text").innerText = "New text";
}
</script>
</head>
<body>
<img id="image" src="https://via.placeholder.com/150/FFFF00/000000?text=closed+door" onclick="updateImageAndText()" />
<!-- Call your function here -->
<p id="text">Initial Text</p>
</body>
</html>

I would like to display text when I press a button [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I would like to know how to put a button on my code and when I click it, it displays text.
For example: when I click it and it should say thank you.
how I can put this in code form?
this is a code based on what I understood from your question
<!DOCTYPE html>
<html>
<body>
<button id="demo" onclick="myFunction()">Click me.</button>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "thank you!";
}
</script>
</body>
</html>

How to add text beside a link in HTML or CSS [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want to add text(which is not part of the link) beside a link. How should I align it beside the link?
For example,
text - link
I want to do it like that
Just type the text within the element, but not inside the link tag. Your link text will be inside a tag.
For example:
<div>Text link</div>
Try like this
<!DOCTYPE html>
<html>
<body>
<ul style="list-style-type:none;" >
<li>Google - <a href="https://www.google.com" >Link</a>
</ul>
</body>
</html>
Output :
Google - Link

HTML Visibility Style [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
Can someone please help me solve this problem. I want to show a submit button when users click on the anchor tag. The problem is, the button is initially hidden, but when I click on the anchor tag, nothing happens
The HTML code is as follows:
<html>
<head>
<style>
#reveal
{
visibility:hidden;
}
</style>
</head>
<body>
<div>
<a href="javascript:" onclick='showButton();'>k...#ccs.neu.edu</a>
</div>
<form>
<input type="submit" value="show email address" id="reveal"/>
</form>
<script type="text/javascript">
function showButton() {
document.getElementById("reveal").style.visibility = visible;
}
</script>
</body>
</html>
Use document.getElementById("reveal").style.visibility = 'visible'; instead of document.getElementById("reveal").style.visibility = visible;
You do not want to assign a variable, but a value, which should be put on quotes.
Use 'visible' instead of visible. You want to use a value, not a variable there.