<a href="page-url" style="pointer-events: none;">Click here</a>Many use :target to make it work, however, this is not always the best choice if we consider its jumping behavior - click on the link below to see what happens:
Link with target
<style>Another option is to use the :focus selector which will make the hidden content to expand on mouse click.
#linktarget {display: none;}
#linktarget:target {display: block;}
</style>
<a href="#linktarget">Link with target</a>
<div id="linktarget">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu cursus dui, ac fermentum eros. Interdum et malesuada fames ac ante ipsum primis in faucibus. Fusce elementum sapien et augue fringilla aliquam. Ut a viverra libero, eget commodo nisi. Maecenas ultrices facilisis dignissim.
</div>
The advantage of this selector is that the page stays still, however, we have to click anywhere "outside" to close the expanded content and besides this, the hidden content should be immediately after, with no intermediate tags:
Demo with focus
<style>The last method is more fancy even though it requires more tags but it works the best since it allows us to create a toggle effect, i.e., expand on click and then collapse when clicking again. In this case, we'll use the :checked selector:
.focuselector {display: none;}
span:focus ~ .focuselector {display: block;}
</style>
<span tabindex="0">Link with focus</span>
<div class="focuselector">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu cursus dui, ac fermentum eros. Interdum et malesuada fames ac ante ipsum primis in faucibus. Fusce elementum sapien et augue fringilla aliquam. Ut a viverra libero, eget commodo nisi. Maecenas ultrices facilisis dignissim.
</div>
<style>To apply these effects on the links and content that you want to hide and expand only on mouse click is very easy: when you create a post, paste one of the codes above inside the HTML box and replace the text in blue with the name of your link and add your text instead of the green one.
.checked-selector {display: none;}
:checked ~ .checked-selector {display: block;}
input.hidden[type=checkbox] {position: absolute;left: -999em;}
</style>
<label for="toggle-hidden">Demo with checked</label>
<input type="checkbox" id="toggle-hidden" class="hidden" />
<div class="checked-selector">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu cursus dui, ac fermentum eros. Interdum et malesuada fames ac ante ipsum primis in faucibus. Fusce elementum sapien et augue fringilla aliquam. Ut a viverra libero, eget commodo nisi. Maecenas ultrices facilisis dignissim.
</div>
Fastest VPS hosting Treatment Donate Recovery Insurance ANNUITY SETTLEMENT Hosting Transfer Donate car to charity California Loans domain registration yahoo domain name yahoo AUTO ACCIDENT LAWYER DENVER Classes Mesothelioma Law Firm Credit Software donate old cars to charity Technology Attormey DUI ATTORNEY ORLANDO Online Classes Donate Car for Tax Credit Mortgage Web Hosting and Domains Blogs Based On Donations Nunavut culture Trading Donate cars in ma Gas/Electricity Lawyer MOTORCYCLE ACCIDENT ATTORNEY LOS ANGLES online making money Claim Dreamhost Rehab Fatcow Conference Call Cord Blood Blogging Making Money online Degree structured settlements annuities mesothelioma survival rates Attomey How much to sell domain name for · Mortgage Adviser mesothelioma claim Loans And Donation Business Casino Health Donate Car to Charity California STRUCTURED ANNUITY SETTLEMENT Donate your car for kids NUNAVUT CULTURE DAYTON FREIGHT LINES structured settlement annuity companies · Better Conferencing Calls mesothelioma attorneys california structured settlement buyer mesothelioma suit

 
No hay comentarios:
Publicar un comentario