Z-index on borders

You cannot do that with a border. Interestingly though, you can do it with an outline * { box-sizing: border-box; } .parent { width: 200px; height: 200px; margin: 25px auto; position: relative; background: #bada55; border:12px solid #663399; outline: 12px solid red; padding:25px } .child { width: 220px; height: 100px; background: lightblue; } <div class=”parent”> <div … Read more

How can I apply a background image to a text input without losing the default border in Firefox and WebKit browsers?

When you change border or background style on text inputs They revert back to the very basic rendering mode. Text inputs that are os-style are usually overlays (like flash is) which are rendered on top of the document. I do not believe there is a pure CSS fix to your problem. Best thing to do … Read more

How do I remove only the top part of a box-shadow?

This works, but I’ll admit to not knowing if there’s a better way (or if it’s possible without adding a wrapper element). Using multiple box-shadows would be a good idea, but I can’t seem to make it look the same. See: http://jsfiddle.net/thirtydot/8qEUc/3/ HTML: <div id=”bla”> <div> something </div> </div> CSS: #bla { overflow-y: hidden; padding: … Read more

Transparent border with background color

The behaviour you are experiencing is that the background of the element appears through the transparent border. If you want to prevent this and clip the background inside the border, you can use: background-clip: padding-box; html, body { height: 100%; margin: 0; padding: 0; background:green; } #nav { position:relative; height: 100%; width: 240px; background-clip: padding-box; … Read more

How to make text stroke in SwiftUI?

Here is a 100% SwiftUI solution. Not perfect, but it works and it gives you full SwiftUI control of the resulting view. import SwiftUI struct SomeView: View { var body: some View { StrokeText(text: “Sample Text”, width: 0.5, color: .red) .foregroundColor(.black) .font(.system(size: 12, weight: .bold)) } } struct StrokeText: View { let text: String let … Read more

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

Set a thin border using .css() in javascript

Current Example: You need to define border-width:1px Your code should read: $(this).css({“border-color”: “#C1E0FF”, “border-width”:”1px”, “border-style”:”solid”}); Suggested Example: You should ideally use a class and addClass/removeClass $(this).addClass(‘borderClass’); $(this).removeClass(‘borderClass’); and in your CSS: .borderClass{ border-color: #C1E0FF; border-width:1px; border-style: solid; /** OR USE INLINE border: 1px solid #C1E0FF; **/ } jsfiddle working example: http://jsfiddle.net/gorelative/tVbvF/\ jsfiddle with animate: http://jsfiddle.net/gorelative/j9Xxa/ … Read more