Div tag for whole page #4785

Closed
opened 2026-02-05 09:15:33 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @ani-6 on GitHub (May 20, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I'm trying to wrap the entire content of a page inside a div tag to apply styles. However, when I edit the source code and save the page, the div tag disappears.
Do we have any workaround for this?
Thanks in advance for your help...

Exact BookStack Version

v24.05

Log Content

No response

Hosting Environment

Docker on Ubuntu 22.04

Originally created by @ani-6 on GitHub (May 20, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I'm trying to wrap the entire content of a page inside a div tag to apply styles. However, when I edit the source code and save the page, the div tag disappears. Do we have any workaround for this? Thanks in advance for your help... ### Exact BookStack Version v24.05 ### Log Content _No response_ ### Hosting Environment Docker on Ubuntu 22.04
OVERLORD added the 🐕 Support label 2026-02-05 09:15:33 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 20, 2024):

There's a lot that the editor will filter out or prevent in an attempt to keep content simple and standard.
We don't (and likely won't) provide official additional controls for this.
If you have an example of what you're attempting to do I may be able to find an alternative method/suggestion.

@ssddanbrown commented on GitHub (May 20, 2024): There's a lot that the editor will filter out or prevent in an attempt to keep content simple and standard. We don't (and likely won't) provide official additional controls for this. If you have an example of what you're attempting to do I may be able to find an alternative method/suggestion.
Author
Owner

@ani-6 commented on GitHub (May 20, 2024):

Screenshot_20240520_161710_Firefox

I am trying to do something like this so i can apply styles to that specific portion.
But after saving its turning like this.

Screenshot_20240520_161738_Firefox

It works perfectly fine if I enclose a or figure tag inside div.

@ani-6 commented on GitHub (May 20, 2024): ![Screenshot_20240520_161710_Firefox](https://github.com/BookStackApp/BookStack/assets/99308429/2bfdec7e-d1ed-40a8-a6bd-8f940932b8e3) I am trying to do something like this so i can apply styles to that specific portion. But after saving its turning like this. ![Screenshot_20240520_161738_Firefox](https://github.com/BookStackApp/BookStack/assets/99308429/dfa0b334-7b49-402d-a84d-aa93199d64d3) It works perfectly fine if I enclose a or figure tag inside div.
Author
Owner

@ssddanbrown commented on GitHub (May 20, 2024):

For something like that you'd need to get inventive, and use something like:

<style>
#bkmrk-this-page-is-marked-,
#bkmrk-this-page-is-marked-+hr,
#bkmrk-this-page-is-marked-+hr+h3 {
  color: red;
}
</style>

There is also tag classes that can help target customizations to specific pages using tags applied the the page:
https://www.bookstackapp.com/docs/admin/hacking-bookstack/#tag-classes

@ssddanbrown commented on GitHub (May 20, 2024): For something like that you'd need to get inventive, and use something like: ```html <style> #bkmrk-this-page-is-marked-, #bkmrk-this-page-is-marked-+hr, #bkmrk-this-page-is-marked-+hr+h3 { color: red; } </style> ``` There is also tag classes that can help target customizations to specific pages using tags applied the the page: https://www.bookstackapp.com/docs/admin/hacking-bookstack/#tag-classes
Author
Owner

@ssddanbrown commented on GitHub (Sep 3, 2025):

Since there's been no further follow-up I'm going to close this off.

@ssddanbrown commented on GitHub (Sep 3, 2025): Since there's been no further follow-up I'm going to close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4785