Positioning a popover with CSS [duplicate] - html

This question already has answers here:
Apply CSS to popover in Bootstrap
(5 answers)
Closed 6 years ago.
I have a popover like this; when the user hovers on first image he sees second image on popover.
<img src="myimage.jpg" rel="mypop" data-content="<img src=" otherimage.jpg ">">
I use this in script tags
$("[rel=mypop]").popover({ placement:'right', html : true });
Everything is ok image is in the middle of page.
But if the user hovers to an image in upper or downer side of page, he can't see proper image.
To solve this issue I suppose I must use CSS.
<style type="text/css">
img[rel="mypop"] {
}
</style>
But I couldn't find what to write into CSS style to show user popover in proper place.
I want user to see popover without conflicting any parts of page.

I used Twitter Bootstrap popover for this.
But I found out that, using popover (for showing images) is not suitable.
So now I use Colorbox to show that kind of data.

Related

How to select text in HTML without a tag [duplicate]

This question already has answers here:
Is there a CSS selector for text nodes?
(3 answers)
Closed 2 years ago.
I am trying to change the layout of a Wordpress plugin, but I have hit a roadblock.
I can't seem to remove the three dots located at the bottom of the download card. They don't seem to have a selector/tag, even Chrome Developer tools won't let me change them.
Image of the three dots
How do I select these three dots so that I can hide them? I can't change the HTML structure because it is generated by a shortcode from the plugin.
I was really curious about this, so I looked it up and finded this: https://css-tricks.com/forums/topic/how-to-target-only-the-stray-text-inside-a-div/.
It seems that no... you can't target them and therefore you can't hide them. Unless...
I haven't tried anything similar, but maybe a dirty solution could be to target the element containing the dots and set the font-size to 0 (I'm assuming the text inside could dissapear) and then in the child elements set the font-size back to normal.

How to center a URL in a html document [duplicate]

This question already has answers here:
Center a div in CSS [closed]
(10 answers)
Closed 4 years ago.
Hi everyone I'm a beginner in HTML, and I need to know how to center an URL inside my web page, for example :
Click Here to Open Google
I tried to use the tag, and the STYLE attribute but it doesn't work.
Can some one help me to make it please ?
You could try in your css file:
a {display:block;text-align:center}
Hope this helps, personally I would add a class name to your a link such as google-link, otherwise this a style will effect all future anchor links :)
So in html file:
Click here to open google
Then in css file:
.google-link {display:block;text-align:center}
In addition your href needs to include a = after it: href="www.google.com"
i think the reason is because your DOM only covers the width of your text link which is "Click Here to Open Google". so centering it with the "center" tag will not give what you want.
Please try this:
<div style='width:100%; text-align:center;'> Click Here to Open Google
Explanation is, you created a "div" element and gave it a 100% width, then specify that anything inside it will be center aligned.
This will solve your problem. Kindly check the codepen link for demo:
https://codepen.io/deepesh316/pen/jQWRYy
For more info about css display block, you can refer w3 schools link:
https://www.w3schools.com/cssref/pr_class_display.asp
You can simply try this solution.
In above, your href should look like below code and then you can use style which will center your link.
<a href:"http://www.google.com" style="text-align:center"> Click Here to Open Google <\a>
Or else you can try
<div text-align="center">your link code here( )......</div>

How do I scroll down a page with <a> tag [duplicate]

This question already has answers here:
How do I link to part of a page? (hash?)
(7 answers)
Closed 6 years ago.
I am making a page on my website that is kind of like a mini wiki. By that I mean I am having a page of information. At the top, I want a table of contents, where you click a link and it scrolls down. I think this would be html, but it might be css.
I used to know how to do this, but I can't remember, nor can I seem to find how to do it anywhere.
So to sum the question up, I want to use an <a> tag in html to, when clicked, scroll to a spot on the page.
As long as you give your content title h1 or similar an id that matches the # request, it will scroll to that content - whether it's on the same page or a different page. Basic example below
Link:
Section Title
Content:
<h1 id="sectiontitle">Section Title Content</h1>
You can use an anchor for that. Prepend the href by a #, and it will scroll to an element on the page with the same id value as what you put after the #.
For example :
Contact
... will link you to this :
<h1 id="contact">Contact us</h1>
... in the same page.

How can I avoid page scrolling up on clicking a simple link (#) [duplicate]

This question already has answers here:
How do I stop a web page from scrolling to the top when a link is clicked that triggers JavaScript?
(16 answers)
Closed 7 years ago.
Is there a way to avoid scrolling page up on clicking a simple link such as the one given below:
Click Me
Try this one:
HTML
<div>Test</div>
Click me
CSS
div{
height: 1000px;
}
The div is only for demonstration.
jsfiddle
You can prevent the default action in a JavaScript event handler with Event.preventDefault() like this:
$('#link').click(function(e){
e.preventDefault();
});
(Assuming the link has the id link You said you use jQuery, so I used jQuery syntax here)
Demo
Try the following one:
Click Me

Hyperlink Input Image

I'm struggling to replicate the login form found at the top of the PayPal website.
I have been able to create the username and password fields including the 'blue glow' from searching the web for tutorials; however, I'm unable to find any coding to add the 'clickable' question mark to the field.
I would like to be able to replicate the drop down when the question mark is clicked.
Any help will be greatly appreciated.
I hope I have made it clear.
What you could do is in your form have the question-mark image trigger a java-function... Ex:
<img src="my_image.jpg" onClick="myjava_function()">
Then in your java function you could have a div containing the drop-down displayed.
<script type="text/javascript">
myjava_function(){
document.getElementById('mydiv').style.display="block"
}
</script>
Then in near the form you could have your div that contains the drop down first being hidden but shown on the click.
<div id="mydiv" style="display:none;"><form><select><option value=1>1</option></select></form></div>
This would be my approach to getting it done. Firstly, try and get a log that is similar to the question mark, and position it in the div that you would place your area at. In the CSS for the logo apply float right so that the logo would appear to the right of that div. Then build a whole div that appears when you click the log before hand and give it the CSS display none, hence it would not be shown. Write a javascript function that works with the onclick you apply on the logo that changes the CSS of that div to display block and hence the whole div appears when you click it. The div by itself has a cross mark that could trigger another javascript call to change the CSS to display none. Good luck.