Is it possible to make a div title appear like this:
I know that I could the the text "Div Title here" inside a div, give it a solid background and position it with absolute coordinates, but I would like the title to be associated with the div, instead of whole document, so I can move the div without worrying about moving the title.
I have set up a fiddle here: http://jsfiddle.net/Eth6U/.
Relative Positioning Move Left - Use a negative value for left. Move Right - Use a positive value for left. Move Up - Use a negative value for top. Move Down - Use a positive value for top.
To set the heading alignment in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <h1> to <h6> tag, with the CSS property text-align. HTML5 do not support the align attribute of the heading tag, so the CSS style is used to set alignment.
You can't style an actual title attribute How the text in the title attribute is displayed is defined by the browser and varies from browser to browser. It's not possible for a webpage to apply any style to the tooltip that the browser displays based on the title attribute.
You can use the <fieldset>
tag for doing this...
Here's an example...
<fieldset>
<legend>Div title here...</legend>
</fieldset>
You can edit the <fieldset>
tag just as a <div>
in CSS...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With