Android – border for button
Step 1 : Create file named : my_button_bg.xml Step 2 : Place this file in res/drawables.xml Step 3 : Insert below code Step 4: Use code “android:background=”@drawable/my_button_bg” where needed eg below:
Step 1 : Create file named : my_button_bg.xml Step 2 : Place this file in res/drawables.xml Step 3 : Insert below code Step 4: Use code “android:background=”@drawable/my_button_bg” where needed eg below:
Here you go: Live demo: http://jsfiddle.net/simevidas/CXUpm/1/show/ (to view the code for the demo, remove “show/” from the URL) Expand snippet
I think you’ve got your understanding of the two properties off a little. Border affects the outside edge of the element, making the element different in size. Outline will not change the size or position of the element (takes up no space) and goes outside the border. From your description you want to use the … Read more
To whomever may have this issue. My problem was border-collapse. It was set to: I set it to: and it fixed the issue.
Set box-sizing property to border-box:
Try being explicit about all the border properties. For example: See Border shorthand property. Although the other bits are optional some browsers don’t set the width or colour to a default you’d expect. In your case I’d bet that it’s the width that’s zero unless specified.
Draw a <rect> round the image which is fill=”none”. You can use the stroke of the <rect> as the border.