gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.41k stars 2.52k forks source link

How to remove the empty space in the left and right? #4909

Closed krNeko9t closed 1 year ago

krNeko9t commented 1 year ago

Is your feature request related to a problem? Please describe.
the web page gradio build have way much empty space in the left and right, can we have some control of it? sorry for the simple question but i could'find it online.

Describe the solution you'd like
A clear and concise description of what you want to happen. like:

with gr.Blocks(margin="no margin"):
...

Additional context
Add any other context or screenshots about the feature request here.

hannahblair commented 1 year ago

Hi @krNeko9t!

We don't have an option like the one you suggested but you can pass custom CSS to the gr.Blocks component.

Here's an example of what you might want:

import gradio as gr

with gr.Blocks(css=""".gradio-container {margin: 0 !important};""") as demo:
    gr.Textbox(label="Test")

demo.launch()

You can read about Custom CSS in gradio here.

abidlabs commented 1 year ago

Thanks @krNeko9t and @hannahblair I'll close this as custom css should suffice and I don't think we'll make it a parameter in Blocks.