ASP.NET -HTML Table row default font - asp.net

Does anybody know what the default font family is in a table row element? I need this because I sometimes put a label in td and the label has a different font from the table column and this causes a visual problem. I want to set my label font the same as the default for the td it sits in.

There is no default font in HTML, if none of the font-families specified in CSS are available on the machine of whoever views your code, it will take the default font that person has set in his browser.
That said, you can't know what font it'll be unless you explicitly specify it in CSS. It's recommended to specify a few font-families the body tag of your pages to be certain of consistency, with the last one being one of the font-families that are always available in HTML. Your label shoud assume the font given in the CSS for the table row or any parent container, if not, give its CSS class property a value and do it that way.

I think the default font is not a stable solution for your problem, why you don't use CSS styling! something like this for both td and lable element..
td, label {
...
font-family: FONT-NAME;
...
}

Related

Stop header style inheriting theme CSS

I am using a plugin on a wordpress site which operates in light/dark mode where I can set the colours manually. However the headers are automatically inheriting the theme colours.
I have tried inspecting the code on the grid to try and isolate the class and create a custom CSS code to remove the inherit property.
The code that the issue exists in is
.tg-barking-mouse a:not([class*="tg-element-"]),
.tg-barking-mouse a:not([class*="tg-element-"]):active,
.tg-barking-mouse a:not([class*="tg-element-"]):focus,
.tg-barking-mouse [class*="tg-element-"] *:not(del) {}
Within this bracket, the margin, padding, color etc exist. When I remove color it does exactly what I would like it to.
However when I paste the same code listed above in CSS and write color:none within the bracket, it doesn't seem to add to the element and overwrite the current color settings.
I believe there is a simple solution which will allow me to isolate the correct element but I'm not too sure what I'm missing.
Is it only the header that has the issue?If it is then you can use css to set your preferable color choice. try include important property like color: #000 !important; or any color of your choice to see if it can do the trick.
Thanks everyone for your help, I was able to work it out by targetting h2 within the class and resolved the issue with the inherit property:
h2.tg-item-title {
color: inherit !important;
}
And it has inherited the plugin's text style rather than the Wordpress theme.

Change a specific block's font size using css

I'm a CSS noob and have not been able to find a solution to my problem.
I run a drupal 7 website.
I need to change a specific block's font size. Using the CSS injector module I've only been able to change the change the font of all blocks using:
.block {font-size: 80%}
Obviously that makes sense as it's got a global application.
The div id for the block is: block-views-new-deals-block-block
The div class for the block is: block block-views contextual-links-region
There's also another div class called: view view-new-deals-block view-id-new_deals_block view-display-id-block view-dom-id-6b4fc98a10e3af5ef7e512f56f8d8c4c
I've tried this with no luck:
.block-views-new-deals-block-block {font-size: 80%;}
I've been messing around with the developer option in Firefox but haven't had any success. I don't know what to try next.
It's difficult to say without the whole HTML, but if the block you want to change the font-size has an ID you can use it like:
#block-views-new-deals-block-block { font-size: 80% }

smartgwt StaticTextItem set css style

I'm trying to set an specific CSS just for a certain item on my form. I would like to make it bold and in a different color. I used the following statement. Why is it not working?
myStaticTextItem.setCellStyle("color:#FF0000; font-weight: bold;");
You can use setTextBoxStyle to assign CSS class to your input box of that element.
There are additional methods for assigning CSS classes for special parts of element like title, hover, hint and picker icon. More here.

Increasing the font size of a button

I have an application made in struts 1.2 and it will be accessed by Desktop browser as well as Android browser. The layout of the DEsktop browser is fine but having problems with the layout in Android browser. Somehow I managed to do the UI look and feel changes but stuck with the button font.
Below is the code I wrote for the button:
<html:submit property="action" value="Login" style="width: 150px;height: 80px;"></html:submit>
The button appearence is fine but the font of the button i.e. Login is very small. I tried adding the font: 100px; in the style attribute but it did not worked.
Any suggestions on how to increase the font size of the submit button text?
Please let me know about this.
Regards,
The font property value must be either a single keyword indicating a system font or contain at least font size and font family, as in font: 100% Calibri. If you wish to set the font size only, do not use the font shorthand but the specific property font-size, e.g. font-size: 30px.
font css attribute isn't what you want.. Use font-size: 100px instead.
In fact with font you can specify multiple font related attributes. Documentation

Ignore previous css definitions

I'm developing an add-on for an existing CMS system. My add-on outputs a link to a style sheet and then outputs a table. The rest of the content(header,left column, footer etc.) is provided by the CMS.
Previously linked CSS styles seems to effect the way my table is displayed. I want to avoid this. I want my table to be shown according to my CSS style. How can I this?
You can add the !important declaration to your style:
table thead th
{
color: #ff0000 !important;
}
Your column headings should have red text now, even if another color has been previously set through another style.
There are only two options:
1) Put the table and its stylesheet in an iframe. Since it is a separate webpage entirely, it won't be affected by stylesheets on the parent webpage.
2) Fully specify the styles of all elements on your table. As long as you override everything the parent page might have specified, your table will look as you want it to.
do you mean a CSS reset? google that for thousands of results.

Resources