Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Having problem with HTML and CSS

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a webpage and put a check box on the page using this line of code

<div class="checkbox" Align="right"> <input type="checkbox" name="keepmeloggedin" value="keep me logged in" checked/> keep me logged in </div>

I then use this line of CSS

.checkbox {position: relative; right: 347px;}

When i apply this CSS code i can no longer click to check or uncheck the box. when i remove the CSS it functions normally but then is not in the position i want it to be in.
Any suggests will help. I'm pretty ignorant to the subject.
 
Marshal
Posts: 67300
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post an SSCCE of jsFiddle showing this issue? I'd like to recreate it.
 
Bear Bibeault
Marshal
Posts: 67300
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And a nit: using both CSS and an attribute such as align="right" is a recipe for disaster. Use CSS and avoid deprecated styling attributes like align.
 
Z Ar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried removing the align right and it does not fix the problem. I am also not familiar with what sscce or jsfiddle are. I'm a very novice user at the moment.
 
Bear Bibeault
Marshal
Posts: 67300
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't say removing the align would fix anything, just that its a bug waiting to happen and a poor practice.

SSCCE
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just wondered how it does not work in your case :

here it works perfectly for me, and for little alignment issue i just remove the align of the check box

here is the working example:

http://jsfiddle.net/pgyejvmo/1/
 
This is my favorite tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!