We need to get the styles of the element that are assigned to it, that is, specifically in the style file. But the snag is that styles can be redefined. For example, if we do this:
var style = $("#menu").css([ "width", "height", "color", "margin", "background-color" ]); console.log(style); So we learn the values of specific styles. But the disadvantage is that if the width style is not registered in the file itself, then jquery will still output the width of the element to us. I hoped that the phpQuery library has a css method that will get styles, but alas.
Question: how else can you get only the actual styles of the element? Using javascript, query or php - any way is relevant.
PS: If we look at the chrome console or fireball, then we note that in the styles column, the browser determines which style overrides the previous one, which is exactly what is required.
