EasyUI Forum
April 30, 2024, 04:04:54 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid-header font size  (Read 9190 times)
jega
Full Member
***
Posts: 190


View Profile
« on: September 16, 2016, 01:30:56 AM »

This works

<style>
    .datagrid-cell{
        font-size: 14px;
    }
    .datagrid-header .datagrid-cell{
        font-weight: bold;
        color: blue;
    }
</style>

Changing cell font size Works

<style>
    .datagrid-cell{
        font-size: 18px;
    }
    .datagrid-header .datagrid-cell{
        font-weight: bold;
        color: blue;

    }
</style>


Changing header font size doesn't Work

<style>
    .datagrid-cell{
        font-size: 18px;
    }
    .datagrid-header .datagrid-cell{
        font-weight: bold;
        color: blue;
        font-size:18px;
    }
</style>

What am i doing wrong ??

Jesper
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 16, 2016, 05:23:34 AM »

Please use this code instead.
Code:
<style>
.datagrid-header .datagrid-cell span{
    font-weight: bold;
    color: blue;
    font-size:18px;
}
</style>
Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #2 on: September 16, 2016, 10:00:43 AM »

Thanks.

But Can you Explain why font-weight and color works in .datagrid-header .datagrid-cell but font size need also span?
Logged
iklotzko
Newbie
*
Posts: 15


View Profile Email
« Reply #3 on: September 26, 2016, 01:31:11 PM »

Jega,

Use the element inspector of your favorite browser. You will see that the header text is wrapped in a span directly under div.datagrid-cell. the div.datagrid-cell selector (in the css file) defines the color and font-weight. However, the div.datagrid-cell span selector defines the font-size. While you can certainly place the font-size in the div.datagrid-cell css, it will be overridden due to css priority definitions.

Also, it is an interesting question from a widget design perspective. Why would they do that? There are actually 2 spans inside the datagrid-cell. One of them is reserved for sorting. Right now the sorting uses a sprite image to display direction, but I guess in the future that could change and perhaps a unicode character could be used. It probably makes sense therefore to split out size. But, that is a guess, if not a reach. Not really sure why.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!