styling

Style the nth letter in a span using CSS

ぃ、小莉子 提交于 2019-11-27 07:42:22
问题 I have: <span id="string">12h12m12s</span> and I'm looking to make the h , m and s smaller than the rest of the text. I've heard of the nth-letter pseudo element in css, but it doesn't seem to be working: #string:nth-letter(3), #string:nth-letter(6), #string:nth-letter(9) { font-size: 2em; } I know I could use javascript to parse the string and replace the letter with surrounding span tags and style the tags. However, the string is updated every second and it seems parsing that often would be

DataGrid / CellTable styling frustration — overriding row styles

穿精又带淫゛_ 提交于 2019-11-27 07:01:25
问题 I'm trying mightily to style my GWT 2.4 DataGrid, and hit roadblocks at every turn. I've added the following row styling to my DataGrid: dataTable.setRowStyles(new RowStyles<IntegrityItem>() { @Override public String getStyleNames(IntegrityItem row, int rowIndex) { if (row.getSomeValue() >= 100) { return MyResources.INSTANCE.mystyles().alertRow(); } else { return ""; } } }); The style alertRow is simply this: .alertEntry { font-weight: bold; color: #00ff00; background-color: #ff0000; } More

Blinking button on WPF application

不想你离开。 提交于 2019-11-27 06:39:09
问题 My WPF application has a style manager that I have built on blend. My problem is this: I've got a login button that blinks occasionally and i can't figure out how to remove this behavior. Here's the style code for my login box: <Style x:Key="LoginBoxGrid" TargetType="{x:Type Grid}"> <Setter Property="Background"> <Setter.Value> <ImageBrush ImageSource="/Client;component/Assets/images/LoginBox.png" Stretch="None" TileMode="Tile"/> </Setter.Value> </Setter> <Setter Property="Opacity" Value="0

Google Custom Search (CSEv2) help on styling?

落爺英雄遲暮 提交于 2019-11-27 06:11:25
问题 I need help on styling the Google Custom Search Box (not the results) Old styles were using the form tags, where you could easily style the look & feel of the search box. <form action="/search" id="searchbox_abc:123" class="search"> <input type="hidden" name="cx" value="abc:12"> <input type="hidden" name="cof" value="FORID:XX"> <input type="text" name="q" size="16" class="smalltext"> <input type="submit" name="sa" value="SEARCH" class="smalltext"> </form> With the new CSEv2 code, it is

How to change the style of a Select box' optgroup label

无人久伴 提交于 2019-11-27 05:17:13
I have a simple select box with an optiongroup in my application. <select> <optgroup label="Swedish Cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> </optgroup> ---- ---- ---- </select> When it gets displayed in browser, the option group label is displayed with bold and italic; I want it to be displayed without any of those styles. Unfortunately select boxes are one of the few things that you can add very little style to with CSS. You are usually limited to how the browser renders it. For example, it looks like this in chrome: And this in Firefox: On most browsers

JavaScript get Styles

偶尔善良 提交于 2019-11-27 05:11:58
Is it possible to get ALL of the styles for an object using JavaScript? Something like: main.css ------- #myLayer { position: absolute; width: 200px; height: 100px; color: #0000ff; } main.js ------- var ob = document.getElementById("myLayer"); var pos = ob.(getPosition); // Pos should equal "absolute" but // ob.style.position would equal null // any way to get absolute? You are talking about what is known as Computed Style , check out these article on how to get it: Get Styles on QuirksMode Get Computed Style Get the rendered style of an element From the last article, here is a function:

textarea's rows, and cols attribute in CSS

帅比萌擦擦* 提交于 2019-11-27 05:09:05
问题 I'd like to set the textarea 's rows and cols attributes via CSS. How would I do this in CSS? 回答1: width and height are used when going the css route. <!DOCTYPE html> <html> <head> <title>Setting Width and Height on Textareas</title> <style> .comments { width: 300px; height: 75px } </style> </head> <body> <textarea class="comments"></textarea> </body> </html> 回答2: <textarea rows="4" cols="50"></textarea> It is equivalent to: textarea { height: 4em; width: 50em; } where 1em is equivalent to

inherit style from default style

北慕城南 提交于 2019-11-27 04:45:42
In my project there is a custom style for text box. It is defined as: <Style TargetType="TextBox"/> So it is applied to all text box child controls by default. I need to create another style that is based on default style. But how do I specify in the BasedOn attribute that my new style should use the default style? Use the type of the control you would like to extend BasedOn="{StaticResource {x:Type TextBox}}" Full example: <Style x:Key="NamedStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}"> <Setter property="Opacity" value="0.5" /> </Style> 来源: https://stackoverflow.com

Styling a GroupBox

偶尔善良 提交于 2019-11-27 04:20:05
问题 I'm trying to create a GroupBox design like this. I have looked at the GroupBox.HeaderTemplate but I'm having problems creating the blue background color, with a width of 100%. The same goes for the border. My code so far <GroupBox.HeaderTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Label Content="{Binding}" HorizontalAlignment="Stretch" Background="#25A0DA" Grid.Column="0" Height="20" Padding="5,0,0,0" Margin="1" Foreground=

Create a System-tray styled box in Winforms (C#)

末鹿安然 提交于 2019-11-27 02:33:11
问题 I've been hunting about for some resources on this, and I can't find any, so I'll bring in here. I want to make a window similar in style to the quick launch box which you see when you open the quick launch bar: Example Window http://img63.imageshack.us/img63/6204/volcontrolstyleguide.png Sadly, I can't find any resources on this; can you help me out? 回答1: It's quite simple. Create a new form, and set ControlBox , MaximizeBox , and MinimizeBox properties to false . Set the Title property to