Inner border over images with CSS?

You can do this without having an extra element or pseudo element: http://cssdeck.com/labs/t6nd0h9p img { outline: 1px solid white; outline-offset: -4px; } IE9&10 do not support the outline-offset property, but otherwise support is good: http://caniuse.com/#search=outline Alternate solution that doesn’t require knowing the dimensions of the image: http://cssdeck.com/labs/aajakwnl <div class=”ie-container”><img src=”http://placekitten.com/200/200″ /></div> div.ie-container { display: inline-block; … Read more

WPF: Remove dotted border around focused item in styled listbox

You need to set FocusVisualStyle of each ListBoxItem to null. Steps are bellow 1) Create ItemContainerStyle for the ListBox <Style x:Key=”ListBoxItemStyle1″ TargetType=”{x:Type ListBoxItem}”> <Setter Property=”FocusVisualStyle” Value=”{x:Null}”/> …. 2) Set that style to Listbox <ListBox ItemContainerStyle=”{DynamicResource ListBoxItemStyle1}”

CSS border less than 1px [duplicate]

A pixel is the smallest unit value to render something with, but you can trick thickness with optical illusions by modifying colors (the eye can only see up to a certain resolution too). Here is a test to prove this point: div { border-color: blue; border-style: solid; margin: 2px; } div.b1 { border-width: 1px; } … Read more

What is the difference between outline and border CSS properties?

From: http://webdesign.about.com/od/advancedcss/a/outline_style.htm The CSS outline property is a confusing property. When you first learn about it, it’s hard to understand how it is even remotely different from the border property. The W3C explains it as having the following differences: Outlines do not take up space. Outlines may be non-rectangular.

How to make a border overlay child div?

You can consider the use of pseudo element to create the border and avoid extra markup. You can also easily control its position/size: body { background: grey; } .button { background: #94c120; width: 200px; height: 50px; margin: 50px; position: relative; } .button:before { content: “”; position: absolute; top: -15px; left: -15px; width: 100%; height: 100%; … Read more

Border within border CSS

When the main triangle or arrow is itself created using the CSS borders, it is impossible to add another border to it without using extra elements. The below are a few options. Option 1: Using a bigger size pseudo-element and positioning it behind the parent to produce a border-effect. .arrow-down { position: relative; width: 0; … Read more

Drawing border colors during a CSS transition

I would use multiple linear-gradient and a complex animation (by animating size/position of each one) to obtain the final result. If you get the trick you can easily adjust the different values to obtain any animation you want. .draw { padding: 20px 50px; outline:none; border: none; box-shadow: none; background-image: linear-gradient(#f45e61, #f45e61), linear-gradient(#f45e61, #f45e61), linear-gradient(#f45e61, #f45e61), … Read more

Android GridView draw dividers

In case you want just simple lines as borders, much, much simpler is setting a background color for a GridView and proper padding & spacing: <GridView (…) android:background=”@color/LightGold” android:listSelector=”@android:color/transparent” android:horizontalSpacing=”1dip” android:verticalSpacing=”1dip” android:paddingLeft=”1dip” android:paddingTop=”1dip” />

Change the borderColor of the TextBox

You can handle WM_NCPAINT message of TextBox and draw a border on the non-client area of control if the control has focus. You can use any color to draw border: using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; public class ExTextBox : TextBox { [DllImport(“user32”)] private static extern IntPtr GetWindowDC(IntPtr hwnd); private const int WM_NCPAINT … Read more