Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SharePoint Online development: defining CSS elements

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Blog Link: blog.51cto.com/13969817

Previous blogs have shared changes to existing CSS elements, always redefining them to fit our needs, and some people may ask why we don't just create new CSS elements, define them the way we want, and use them again.

You can do this, but it's not as simple as you think, the code in HTML on SharePoint sites is quite complex, there are multiple CSS tables called and multiple element classes, they may all be wrapped into a single ID in some places, it's a complex web, if you modify existing CSS, you're just changing the way it behaves, and you don't change any of the underlying structure.

If Microsoft makes changes to the code, they usually reuse element names, which means your custom CSS is likely to be retained, and if you make changes to the underlying HTML of your site when you create a custom master page, it may fail or prevent the upgrade deployment the next time.

You're just changing the way it behaves. If Microsoft makes changes to the code, they often reuse element names, which means your custom CSS definitions are likely to be preserved. If you make changes to the underlying HTML of your site the way you did when you created your custom master page, I can almost guarantee that it will fail the next time you upgrade, or block the upgrade deployment, which means either staying with the current release of SharePoint and missing the new version of New Features, or requiring more development and maintenance time.

But if you want to change some of the look of the site through CSS, for example, you want to publish news regularly through a page of the site, and you want to keep all pages consistent, requirements: publish news, archive old news consistent page appearance: need two layers of headings; need some content text; need bulleted lists; no underlining on hyperlinks These can be set with CSS code, we come back to the stylesheet, as follows:

Example code:

.newheader1 {/this is the main headline of the news/

font-size: x-large ! important;

font-weight: bold ! important;

color: darkred ! important;

}

.newheader2 {/this is the secondary headline of the news/

font-size: large ! important;

color: darkred ! important;

}

.newscontent {/this is content text/

font-family:"Times New Foman",Georgia,Serif;

}

Newhead1 and 2 correspond to the settings of two titles respectively, Newscontent is the relevant setting of news content, and the example code is for reference only.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report